Refactoring

pull/147/head
M66B 6 years ago
parent ae60ef75b8
commit f628fa0942

@ -691,22 +691,29 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
}.execute(this, args, "setup:import"); }.execute(this, args, "setup:import");
} }
BroadcastReceiver receiver = new BroadcastReceiver() { private void onEditAccount(Intent intent) {
@Override
public void onReceive(Context context, Intent intent) {
if (ACTION_EDIT_ACCOUNT.equals(intent.getAction())) {
FragmentAccount fragment = new FragmentAccount(); FragmentAccount fragment = new FragmentAccount();
fragment.setArguments(intent.getExtras()); fragment.setArguments(intent.getExtras());
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("account"); fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("account");
fragmentTransaction.commit(); fragmentTransaction.commit();
} else if (ACTION_EDIT_IDENTITY.equals(intent.getAction())) { }
private void onEditIdentity(Intent intent) {
FragmentIdentity fragment = new FragmentIdentity(); FragmentIdentity fragment = new FragmentIdentity();
fragment.setArguments(intent.getExtras()); fragment.setArguments(intent.getExtras());
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("identity"); fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("identity");
fragmentTransaction.commit(); fragmentTransaction.commit();
} }
BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (ACTION_EDIT_ACCOUNT.equals(intent.getAction()))
onEditAccount(intent);
else if (ACTION_EDIT_IDENTITY.equals(intent.getAction()))
onEditIdentity(intent);
} }
}; };
} }

Loading…
Cancel
Save