mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
6752793a6d
commit
ab93c3351b
|
@ -205,8 +205,22 @@ public class FragmentBase extends Fragment {
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
Log.i("Create " + this + " saved=" + (savedInstanceState != null));
|
Log.i("Create " + this + " saved=" + (savedInstanceState != null));
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
if (savedInstanceState != null)
|
if (savedInstanceState != null)
|
||||||
subtitle = savedInstanceState.getString("fair:subtitle");
|
subtitle = savedInstanceState.getString("fair:subtitle");
|
||||||
|
|
||||||
|
// https://developer.android.com/training/basics/fragments/pass-data-between
|
||||||
|
getParentFragmentManager().setFragmentResultListener(getClass().getName(), this, new FragmentResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onFragmentResult(@NonNull String requestKey, @NonNull Bundle result) {
|
||||||
|
int requestCode = result.getInt("requestCode");
|
||||||
|
int resultCode = result.getInt("resultCode");
|
||||||
|
|
||||||
|
Intent data = new Intent();
|
||||||
|
data.putExtra("args", result);
|
||||||
|
onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -219,19 +233,6 @@ public class FragmentBase extends Fragment {
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
Log.d("Activity " + this + " saved=" + (savedInstanceState != null));
|
Log.d("Activity " + this + " saved=" + (savedInstanceState != null));
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
|
||||||
getParentFragmentManager().setFragmentResultListener(getClass().getName(), getViewLifecycleOwner(), new FragmentResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onFragmentResult(@NonNull String requestKey, @NonNull Bundle result) {
|
|
||||||
int requestCode = result.getInt("requestCode");
|
|
||||||
int resultCode = result.getInt("resultCode");
|
|
||||||
|
|
||||||
Intent data = new Intent();
|
|
||||||
data.putExtra("args", result);
|
|
||||||
onActivityResult(requestCode, resultCode, data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
scrollTo();
|
scrollTo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue