mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-03-31 22:02:08 -04:00
Start shortcuts with singleTop, but not all launches
This will prevent shortcuts from creating many views, and causing them to leak. However, do not use singleTop for all launches of the view activity, else the edit mode cannot be entered.
This commit is contained in:
@@ -322,6 +322,9 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
|
||||
{
|
||||
Intent shortcutIntent = new Intent(this, LoyaltyCardViewActivity.class);
|
||||
shortcutIntent.setAction(Intent.ACTION_MAIN);
|
||||
// Prevent instances of the view activity from piling up; if one exists let this
|
||||
// one replace it.
|
||||
shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt("id", id);
|
||||
bundle.putBoolean("view", true);
|
||||
|
||||
Reference in New Issue
Block a user