getresources「getResourceStream」
android工程编译成功后,会自动生成一个Rjava文件,类似于stringxml里的ltstring项都会在在这个文件中有一个Integer类型,程序会根据这个值最终找到对应stringxml里的哪个ltstring项,你可以看看Rjava文件,除了。
方法一重写此类的构造方法,在其他页面调用的时候,传入Context,直接利用 ContextgetResources方法二通过全局的application来获取 QDApplicationContext为自定义的application,getInstance用来获取实例对象 QDApplication。

android无法获取res资源文件夹路径,只能通过系统提供的封装函数访问资源文件夹有resdrawable ,通过getresources访问 resvalues ,通过getresources访问 reslayout,通过getresources访问 resxml,通过get。
链式语法而已, 没啥特殊含义, 你基础太差了 才会对这个有疑问比如入门经常用的Scanner案例Scanner sc = new ScannerSysteminint i = scnextInti使用链式语法可以写成System。
第一个参数格式是包名 + +资源文件夹名 + +资源名是这种格式 然后其他的可以为null 2方式二 Resources resources = contextgetResourcesintindentify= getResourcesgetIdentifierquoticonquot, quotdrawablequot。