I have several buttons on my view, each of which that opens other applications. Calendar, Clock, Calculator etc etc.
I am using the following code to get a list of apps and then I can select which one to run -
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = getActivity().getPackageManager().queryIntentActivities( mainIntent, 0);
startActivity(mainIntent);
So I have this method set up for my Calendar button and my Clock button. I have chosen the clock app for my clock button and I have set it as default. But when I click on the Calendar button to choose, it automatically opens the clock app. I've tried this with other buttons, it wont let me choose, instead it opens the clock app, how can I set it up in a different way where I can select the clock app for clock and calendar for calendar?
I have previously asked a question about this and I got an answers and used that method which was above, there is also no tutorials i can find about this either.
Thanks for reading.