0

I am trying to get this(switching between multiple activities) from many days...atlast i tried to do it using intent flags

Intent intent = new Intent(getApplicationContext(),Act1.class);

if(a1)  // a1 is set true during oncreate of act1
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);

startActivity(intent) ;

Will this work ?? Or any other ways ?? I am not getting here. what i exactly needed

Lucifer
  • 29,392
  • 25
  • 90
  • 143
Anand Kumar
  • 66
  • 2
  • 8
  • Remove this line intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); and then run. – Aerrow May 21 '12 at 08:55
  • I wanted to bring the background activity into foreground...i wanted to switch activities between webviews...i dont wanted to load them again .. – Anand Kumar May 21 '12 at 09:53

1 Answers1

1

Declaring in manifest as android:launchMode="singleInstance" under the respective activty xml tag like

[this](http://developer.android.com/guide/topics/manifest/activity-element.html" ") works

Anand Kumar
  • 66
  • 2
  • 8