0

I am trying to do it like :

startActivity(new Intent(ActivityRating.this, ActivityRating.class).putExtra("Type", AppConstant.PRODUCT_REVIEW).putExtra("Id", review.getId()).putExtra("paramStore", mVendor));
finish();

Activity close but it didn't open again? with this code.

I found the Solution

Intent intent = new Intent(ActivityRating.this, ActivityRating.class).putExtra("Type", AppConstant.PRODUCT_REVIEW).putExtra("Id", review.getId()).putExtra("paramStore", mVendor);
                    finish();
                    startActivity(intent);
Waqar Khan
  • 42
  • 6
  • Possible duplicate of [How do I restart an Android Activity](https://stackoverflow.com/questions/1397361/how-do-i-restart-an-android-activity) – ישו אוהב אותך Feb 25 '19 at 06:01
  • Why are you using single instance launch mode? This isn't necessary and is the root of your problem. This is one of the reasons why you should not use the special launch modes. – David Wasser Feb 25 '19 at 14:04
  • 1
    Why do you want to restart your `Activity`? Can't you just reinitialize it internally? There should be no reason to restart it like this – David Wasser Feb 25 '19 at 14:05

1 Answers1

0

implement this method

@Override
protected void onNewIntent(Intent intent) {
    // TODO Auto-generated method stub
    super.onNewIntent(intent);

}
Sohel S9
  • 246
  • 1
  • 15