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
-~----------~----~----~----~------~----~------~--~---

Reply via email to