Ich habe ein Problem mit dem Aufblasen, ich weiß nicht, wie man es löst, weil es ein seltsames Problem ist. Ich habe einen Absturz in meiner BaseFragment
Klasse in Zeile 60 für Samsung und Huawei Geräte (Huawei gra_l09). Code sieht wie folgt aus:android.view.InflateException: Binär XML-Datei Linie - wie zu vermeiden
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
int contentView = onFragmentContentView();
if(contentView == 0)
throw new IllegalArgumentException("onFragmentContentView must be not equal 0");
View layout = inflater.inflate(contentView, container, false); //!!line 60
ButterKnife.inject(this, layout);
onCreateFragmentView(layout, container, savedInstanceState);
return layout;
}
Ich bin mir nicht sicher, ob das Thema ein Grund ist? Ich habe Theme.AppCompat.Light verwendet.
Fatal Exception: android.view.InflateException: Binary XML-Datei Zeile
2: Fehler aufblasen Klasse
at android.view.LayoutInflater.createView(LayoutInflater.java:633) at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:892) at android.view.LayoutInflater.rInflate(LayoutInflater.java:802) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at com.vyda.stream.fragments.BaseFragment.onCreateView(BaseFragment.java:60) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763) at java.lang.reflect.Constructor.newInstance(Constructor.java) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.view.LayoutInflater.createView(LayoutInflater.java:607) at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:892) at android.view.LayoutInflater.rInflate(LayoutInflater.java:802) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at com.vyda.stream.fragments.BaseFragment.onCreateView(BaseFragment.java:60) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:977) > byte allocation with 3357954 free bytes and 3MB until OOM at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763) at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java) at android.graphics.BitmapFactory.nativeDecodeAsset(BitmapFactory.java) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444) at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988) at android.content.res.Resources.loadDrawableForCookie(Resources.java:2480) at android.content.res.Resources.loadDrawable(Resources.java:2387) at android.content.res.TypedArray.getDrawable(TypedArray.java:749) at android.view.View.<init>(View.java:3754) at android.view.ViewGroup.<init>(ViewGroup.java:498) at android.widget.RelativeLayout.<init>(RelativeLayout.java:249) at android.widget.RelativeLayout.<init>(RelativeLayout.java:245) at android.widget.RelativeLayout.<init>(RelativeLayout.java:241) at java.lang.reflect.Constructor.newInstance(Constructor.java) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.view.LayoutInflater.createView(LayoutInflater.java:607) at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:892) at android.view.LayoutInflater.rInflate(LayoutInflater.java:802) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at com.vyda.stream.fragments.BaseFragment.onCreateView(BaseFragment.java:60) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:977) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763)
[Bearbeiten]: Vollständiger Klassencode: http://pastebin.com/nSCpY35Y
Was gibt onFragmentContentView() zurück? – Alexander
Fügen Sie auch Ihre Layout-XML-Datei hinzu - so können wir sie auch untersuchen und sehen, ob es dort irgendwelche Probleme gibt. – ishmaelMakitla
Dies ist eine abstrakte Methode, die in jeder untergeordneten Klasse überschrieben wird. Es gibt void zurück. Allgemein Ich benutze diese Methode, um einige Init-Methoden aufzurufen oder Objekt zu injizieren – Michael