0

In my project, I have 3 activities, A-> B -> C. In C activity it has order button, after clicked order button I also have to pass a bundle by intent to A activity and I would like A activity to be showed again. How could I just show A activity again?

Thanks,

SAWJUSTO
  • 369
  • 1
  • 5
  • 19

1 Answers1

0

Depend on your requirement , if you wants to finish activty B and c on Button Click then use Flag FLAG_ACTIVITY_CLEAR_TOP with intent flag. in this case on newIntent will be called, you can get bundle from it.

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

if you do not wants to close activity B and C then use 

Intent intent = new Intent(this, YourActivity.class);
Bundle bundle = new Bundle();
intent.putextras(bundle);
startActivity(intent);

if any issue then let me know.

Hradesh Kumar
  • 1,765
  • 15
  • 20
  • Intent i=new Intent(mContext,MainActivity.class); i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); I used this lines of code before to call MainActivity.java, it is ok, the problem the fragment in MainActivity.java doesn't show form stat data such as user selected item of spinner and user entered data of edittext. – SAWJUSTO Sep 05 '14 at 10:44