0

more than one activity use in application click song notification already open application not reopen application how to solve this error

  Intent notificationIntent = new Intent(this, MainActivity.class);
    notificationIntent.setAction(Control.ACTION.MAIN_ACTION);

    PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
            notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

   <activity
        android:name=".Activity.MainActivity"
        android:launchMode="singleTop"
        android:configChanges="orientation|keyboardHidden|screenLayout|screenSize" />

and i have declare android:launchMode="singleTop" all activity in android manifest file

InsaneCat
  • 2,115
  • 5
  • 21
  • 40
Kishan Viramgama
  • 893
  • 1
  • 11
  • 23

1 Answers1

0

android:launchMode="singleTop"

It means if the activity is already there on the top, it won't create an another instance. Instead onNewIntent() of an activity will get called with updated intent as a parameter.

@Override
public void onNewIntent(Intent intent) {
    // Deal with new Intent over here...
}
Paresh P.
  • 6,677
  • 1
  • 14
  • 26