When you make startActivity() using chooser, Android will present a list of all applications that have the right to process your Intent , as well as parameters to set this assignment both permanently and once (on the ICS there is a button "Always" and "Only once" , at 2.x this is a check box). However, for this code:
public class Redirector { public static void showActivityWithChooser( Context context, int chooserLabelTitleId, Intent intent ) { try { context.startActivity( Intent.createChooser( intent, context.getResources().getString( chooserLabelTitleId )) ); } catch( Exception e ) { e.printStackTrace(); } } public static void viewInExternalApplication( Context context, String url ) { Intent intent = new Intent( Intent.ACTION_VIEW ); intent.setData( Uri.parse( url ) ); intent.addFlags( Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET ); showActivityWithChooser( context, R.string.open_chooser_title, intent ); } }
I donβt see the "Always only once" buttons and cannot make my choice permanent (I only got a list of applications and can launch them by clicking on it). What elementary I overlooked that Android could not make the user's choice permanent?
Take a look at the photos: the left dialog is what I would like to see, but really is what I get now (a different number of applications in both dialogs does not matter):

android android-intent
Marcin orlowski
source share