I am creating an app to run multiple tasks within a same activity. I am achieving this using fragments. Now, I want to run a game which is installed on my phone in a fragment within my activity.
I tried this :
PackageManager pm = getActivity().getPackageManager();
Intent intent = pm.getLaunchIntentForPackage("com.exo.drive");
getActivity().startActivityFromFragment(this, intent, getTargetRequestCode());
But this as expected opens another activity and launches the game. How do I make the game run within my fragment?