Fixed change fragment crash on Android 4.x
This commit is contained in:
parent
0907fe2d5b
commit
e7f5c46529
@ -2,7 +2,6 @@ package org.itxtech.daedalus.fragment;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.VpnService;
|
import android.net.VpnService;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -56,20 +55,12 @@ public class MainFragment extends Fragment {
|
|||||||
});
|
});
|
||||||
|
|
||||||
updateUserInterface();
|
updateUserInterface();
|
||||||
|
mHandler = (new MainFragmentHandler()).setFragment(this);
|
||||||
|
MainActivity.getInstance().setMainFragmentHandler(mHandler);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Context context) {
|
|
||||||
super.onAttach(context);
|
|
||||||
|
|
||||||
if (context instanceof MainActivity) {
|
|
||||||
mHandler = (new MainFragmentHandler()).setFragment(this);
|
|
||||||
((MainActivity) context).setMainFragmentHandler(mHandler);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDetach() {
|
public void onDetach() {
|
||||||
super.onDetach();
|
super.onDetach();
|
||||||
|
Loading…
Reference in New Issue
Block a user