I am working on an app where I am useing a PackageManager
to import all the package names on the device using this code:
protected void onListItemClick(ListView l, View v, int position, long id) {
ResolveInfo launchable=adapter.getItem(position);
ActivityInfo activity=launchable.activityInfo;
ComponentName name=new ComponentName(activity.applicationInfo.packageName,
activity.name);
Intent i=new Intent(Intent.ACTION_MAIN);
i.addCategory(Intent.CATEGORY_LAUNCHER);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
i.setComponent(name);
startActivity(i);
}
This code manage to start the app from a ListView
. But I want to send the app details to another class to start it from there instead of starting it from this class. Then I want the result to be saved but changeable by clicking on another app later.
Are there any ways of doing this?