Last active
December 31, 2015 22:59
-
-
Save rafacouto/8056818 to your computer and use it in GitHub Desktop.
See "Error inflating class fragment" answer: http://stackoverflow.com/a/20685549/470091
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.treboada.mytests.fragments; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.util.AttributeSet; | |
public class XmlFragment extends android.support.v4.app.Fragment { | |
@Override | |
public void onInflate(Activity activity, AttributeSet attrs, | |
Bundle savedInstanceState) { | |
android.support.v4.app.FragmentManager fm = getFragmentManager(); | |
if (fm != null) { | |
fm.beginTransaction().remove(this).commit(); | |
} | |
super.onInflate(activity, attrs, savedInstanceState); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment