OK... found this but have NO idea how to make this work. Not even sure if this is what I want but I think it is.
So what I am seeing here is.
Get an instance ActivityManager.
Get the task.id of my app.
make the call to moveTaskToFront
I am thinking maybe JavaObject or reflection? If one of you gurus could get me pointed in the right direction I would really appreciate it.
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List<RunningTaskInfo> tasklist =am.getRunningTasks(10); // Number of tasks you want to get
Then, you will have the active app list in tasklist.
moveTaskToFront () function will bring the app to foreground.
if(!tasks.isEmpty())
{
int nSize = tasklist.size();
for(int i = 0; i >= nSize; i++)
{
RunningTaskInfo taskinfo = tasklist.get(i);
if(taskinfo.topActivity.getPackageName().equals("name of the package"))
{
am.moveTaskToFront(taskinfo.id, 0);
}
}
}
and then...
Finally, add permissions to the manifest.
<uses-permission android:name="android.permission.
GET_TASKS" />
<uses-permission android:name="android.permission.
REORDER_TASKS" />
Thanks all and thanks udg!