mirror of https://github.com/readrops/Readrops.git
Add only forward flag when coming from main activity
This commit is contained in:
parent
52219995bb
commit
14596c75fd
|
@ -41,10 +41,15 @@ public class AccountTypeListActivity extends AppCompatActivity {
|
|||
binding.accountTypeRecyclerview.setLayoutManager(new LinearLayoutManager(this));
|
||||
binding.accountTypeRecyclerview.addItemDecoration(new DividerItemDecoration(this, LinearLayout.VERTICAL));
|
||||
|
||||
boolean fromMainActivity = getIntent().getBooleanExtra("fromMainActivity", false);
|
||||
|
||||
adapter = new AccountTypeListAdapter(accountType -> {
|
||||
if (!(accountType.getAccountType() == Account.AccountType.LOCAL)) {
|
||||
Intent intent = new Intent(getApplicationContext(), AddAccountActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
|
||||
|
||||
if (fromMainActivity)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
|
||||
|
||||
intent.putExtra("accountType", accountType);
|
||||
|
||||
startActivity(intent);
|
||||
|
|
|
@ -145,6 +145,7 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
|
|||
switch (id) {
|
||||
case DrawerManager.ADD_ACCOUNT_ID:
|
||||
Intent intent = new Intent(this, AccountTypeListActivity.class);
|
||||
intent.putExtra("fromMainActivity", true);
|
||||
startActivityForResult(intent, ADD_ACCOUNT_REQUEST);
|
||||
break;
|
||||
case DrawerManager.ACCOUNT_SETTINGS_ID:
|
||||
|
|
Loading…
Reference in New Issue