It might be helpful to see also the logcat trace of your crash. Have you tried to use the debugger or debug prints to find out where and when exactly your code crashes?
I am assuming that you have defined the following permission in your Manifest <uses-permission id="android.permission.GET_TASKS"/> -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 17, 9:08 am, Tikoze <janderson....@gmail.com> wrote: > Here is the code that I am using to bring a "running" activity > to the foreground: > > ActivityManager.RunningTaskInfo task = getTask(idx); > if (task != null) > { > Intent intent = new Intent(); > intent.setClassName(task.topActivity.getPackageName(), > task.topActivity.getClassName()); > intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); > > try > { > m_context.startActivity(intent); > } > catch (ActivityNotFoundException e) > { > Toast.makeText(m_context, "Unable to launch > activity...", Toast.LENGTH_SHORT).show(); > } > > } > > - Crash Scenario 1: > Switching to any task in the list of running task that has started > another activity (i.e. task.topActivity and task.baseActivity are > different) causes a crash. I have tried the code above using both > task.topActivity and task.baseActivity but the results are the same... > force close. > > - Crash Scenario 2: > Switching to specific tasks always causes a force close. For example, > when I try to switch to the Calendar Task when it is "running" my > program always crashes. However, I can successfully switch to Google > Maps, Home, Browser, and most others. > > I have been unable to find any information about these issue anywhere > in google groups or on the internet... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---