0

I have code which was working before Ice cream sandwich was born. but seems like now i have problem with this kid.

Intent intent=new Intent(this, com.myUI.class)
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP 
            | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);

By the way i am trying to put my UI on foreground after call finishes. My app automatically dial and suppose to show own UI after dialer done with call or at least it was doing this so far without any issue.

Guys what i am doing wrong and what should i do to fix it?

Graham Smith
  • 25,627
  • 10
  • 46
  • 69
minhaz
  • 4,233
  • 3
  • 33
  • 49
  • try pushing activity front of the activities using activitymanager. Try this [link](http://developer.android.com/reference/android/app/ActivityManager.html#moveTaskToFront%28int,%20int%29) – Harshawardhan Apr 27 '12 at 19:02

1 Answers1

0

I had the same problem and have changed to the code below. Seems to be working well.

PackageManager pm = context.getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(context.getPackageName());
intent.addFlags( Intent.FLAG_ACTIVITY_REORDER_TO_FRONT );
context.startActivity(intent);

Hope that helps

Michael
  • 3,776
  • 1
  • 16
  • 27