1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
public
Context getThemeContext() {
if
(mType == ThemeManager.THEME_TYPE_NATIVE)
return
mDefContext ;
if
(mContext !=
null
)
return
mContext ;
if
(TextUtils.isEmpty( mPkg)
|| mDefContext.getPackageName().equals(mPkg ))
mContext = mDefContext;
try
{
mContext = mDefContext.createPackageContext(mPkg ,
Context. CONTEXT_INCLUDE_CODE
| Context.CONTEXT_IGNORE_SECURITY );
}
catch
(NameNotFoundException e) {
e.printStackTrace();
}
return
mContext ;
}
|
Android资源命名规范
最新推荐文章于 2021-05-25 21:03:18 发布