哪里getResources()方法来实现? [英] Where is the getResources() method implemented?

查看:177
本文介绍了哪里getResources()方法来实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道哪里是 getResources()方法来实现?它是在 android.content.Context 抽象方法类,但我不能找出哪些类实现呢?我发现了一个回答这里左右,但现在看来,这是不正确的答案。

Does somebody know where is the getResources() method implemented? It is abstract method in android.content.Context class but I cannot find out which class implements it? I found an answer here on SO but it seems it is not the right answer.

我正在寻找,因为我想知道它究竟它实现 getResources()方法的特定类。

I am searching a particular class which implements getResources() method because I want to know what it exactly does.

我在哪里可以找到它的东西呢,不仅调用别的东西的实施?

Where can I find the implementation which "something does", not only calls something else?

推荐答案

ContextImpl 是规范上下文实现类。它有一个初始化的 mResources 成员变量,它可以与进行随后访问getResources()方法很多

ContextImpl is the canonical Context implementation class. It has many ways for initializing its mResources member variable which can be then accessed with getResources().

上下文取值按照通常活动 - ContextThemeWrapper - ContextWrapper 继承路径<一个href=\"http://androidxref.com/4.4.2_r2/xref/frameworks/base/core/java/android/content/ContextWrapper.java#87\"相对=nofollow>委托 getResources()来的基本上下文。在<一个href=\"http://androidxref.com/4.4.2_r2/xref/frameworks/base/core/java/android/app/ActivityThread.java#2139\"当创建活动相对=nofollow>基本上下文设置为 ContextImpl 实例。

Contexts following the usual Activity - ContextThemeWrapper - ContextWrapper inheritance path delegate getResources() to the base context. The base context is set up as ContextImpl instance when the activity is created.

这篇关于哪里getResources()方法来实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆