2

我不断收到带有 FileNotFoundException 异常的谷歌播放崩溃报告

java.io.FileNotFoundException: res/layout/newday.xml
at android.content.res.AssetManager.openXmlAssetNative(Native Method)
at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:533)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2132)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2105)
at android.content.res.Resources.getLayout(Resources.java:857)
at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:262)
at android.app.Activity.setContentView(Activity.java:1867)
at com.mycompany.myapp.activities.NewDayActivity.onCreate(SourceFile:75)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2035)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2096)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4787)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)

我的应用程序包是 com.mycompany.myapp。这不会经常发生。抱怨此问题的用户还表示,这种情况发生在 50% 的情况下。那有什么问题呢?

在活动中,我使用这种方法

protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.newbodymeasureday);
}

在 super.onCreate(arg0) 我有这个

getWindow().setFormat(PixelFormat.RGBA_8888);

我在这个超级电话中也有一个主题变化

String theme = SharedPrefsUtils.getCustomTheme(act);
String[] codes = act.getResources().getStringArray(R.array.themes_codes);
if (theme != null && theme.equals(codes[1])) {
    act.setTheme(R.style.GymGymTheme);
    Log.d(TAG, "Theme Light");
}
4

0 回答 0