diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-05-12 18:15:58 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-05-12 18:15:58 +0300 |
commit | 67e1e9f34004dbc40e3273e6ba41a8e114355223 (patch) | |
tree | b6766bffb5e763ba6f42952cdb3a58909907e367 /app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java | |
parent | d834989632569821211961e66eb534dfa0e790d9 (diff) |
#217 SingleCardWidget
Fix relaunch
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java index a41c966b6..8aa9fdbd2 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java @@ -73,14 +73,25 @@ public class EditActivity extends BrandedActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - Thread.currentThread().setUncaughtExceptionHandler(new ExceptionHandler(this)); - binding = ActivityEditBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); - setSupportActionBar(binding.toolbar); + viewModel = new ViewModelProvider(this).get(EditCardViewModel.class); + syncManager = new SyncManager(this); + + loadDataFromIntent(); + } + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + loadDataFromIntent(); + } + + private void loadDataFromIntent() { final Bundle args = getIntent().getExtras(); if (args == null || !args.containsKey(BUNDLE_KEY_ACCOUNT) || !args.containsKey(BUNDLE_KEY_BOARD_ID)) { @@ -89,9 +100,6 @@ public class EditActivity extends BrandedActivity { long cardId = args.getLong(BUNDLE_KEY_CARD_ID); - viewModel = new ViewModelProvider(this).get(EditCardViewModel.class); - syncManager = new SyncManager(this); - if (cardId == 0L) { viewModel.setCreateMode(true); if (!args.containsKey(BUNDLE_KEY_STACK_ID)) { |