When you do startActivity()
with chooser, Android would list all apps entitled to handle your Intent
along with options to set this assignment permanent or once-time (on ICS its "Always" and "Just once" action button, on 2.x it's checkbox). 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 see no "Always|Just once" buttons and cannot make my selection permanent (I got apps listed only and can fire any by tapping it). What elementary I overlooked that made Android unable to make user choice persistent?
See the pics: left dialog is what I'd like to see, but right is what I get now (different number of applications in both dialogs is irrelevant):