Thanks Phyll,
I opened browser from my activity using browser intent. And what i want to do now is after some time close the browser. As u told by using Activity manager, Am able to get the recent processes list and tasks list by using the following code.
Using java Syntax Highlighting
ActivityManager am = (ActivityManager)getApplicationContext().getSystemService(Context. ACTIVITY_SERVICE);
List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasks(5, 0);
List<ResolveInfo> riList;
PackageManager pm = getApplicationContext().getPackageManager();
riList = new ArrayList<ResolveInfo>(10);
for (ActivityManager.RecentTaskInfo task : recentTasks)
{
// Remove top activity
if (task.baseIntent.hasCategory(Intent.CATEGORY_BROWSABLE))
continue;
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
ResolveInfo ri = pm.resolveActivity((intent),1);
if (ri != null && riList.size() < 10)
riList.add(ri);
}
recentTasks.clear();
Parsed in 0.033 seconds, using
GeSHi 1.0.8.4
But i am not able to kill the browser activity(i.e the browser is opened my application). and still the browser activity is the top activity.
If some one knows the solution, please give reply.
Thanks
Shailaja