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,012
  • 5
  • 19
  • 35
Kishan Viramgama
  • 775
  • 1
  • 10
  • 22

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,393
  • 1
  • 13
  • 25