可以通过android.content.Context的getResources()的得到Resources()句柄。<wbr style="line-height:25px"><br style="line-height:25px"><span style="line-height:1.3em">然后可以通过</span><wbr style="line-height:25px"><span style="line-height:1.3em">Resources()句柄的函数得到各类资源:</span><wbr style="line-height:25px"><br style="line-height:25px"><span style="line-height:1.3em">比如得到</span><wbr style="line-height:25px"><span style="line-height:1.3em">drawable:</span><wbr style="line-height:25px"><br style="line-height:25px"><span style="line-height:1.3em">getResources().getDrawable(R.drawable.pbook_tab_groups))</span><wbr style="line-height:25px"><br style="line-height:25px"><span style="line-height:1.3em">比如得到</span><wbr style="line-height:25px">RawResource的输入流<br style="line-height:25px"> InputStreamis=<span style="line-height:25px"><wbr style="line-height:25px">getResources</wbr></span><wbr style="line-height:25px">().openRawResource(R.drawable.balloons)<br style="line-height:25px"> 比如得string:<br style="line-height:25px"> StringgetString(intid)<br style="line-height:25px"><br style="line-height:25px"> 对于String也可以通过下面的方式取得:<br style="line-height:25px"> 可以通过android.content.Context的<span style="line-height:1.3em">getString(intid)取得。</span><wbr style="line-height:25px"><br style="line-height:25px"><span style="line-height:1.3em">比如:</span><wbr style="line-height:25px"><br style="line-height:25px"><span style="line-height:1.3em">getString(R.string.groupIconLabel)</span></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>