I\'m trying to do something I do with activities, but within a fragment. What I do is using activities:
First stop the activity restarts when rotating the device
a
Maybe you can try use
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.frg.myFragment, container, false);
}
. In any case, the fragment still has to be destroyed and recreated, why not let Android handle it automatically by restarting the activity? If there is any data to keep, you can save it in onSavedInstanceState()
. Setting android:configChanges="keyboardHidden|orientation|screenSize"
is not recommended in Android.