Android 查找布局文件时发生异常

Android 查找布局文件时发生异常,android,Android,我不断收到带有FileNotFoundException的google play崩溃报告 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 an

我不断收到带有FileNotFoundException的google play崩溃报告

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");
}

我们还需要看到一些Java代码。你的应用程序包中有布局文件res/layout/newday.xml吗?你能将用户分组为“仅使用此android版本/设备”吗?如果是,在哪个api/设备上会发生这种情况?Axarydax。是的,没错。在res/layout/newday.xml.Sajmon中,更新了我的答案