Reputation: 3891
I've written a small application which allows to load up an image from gallery by running these lines of code:
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, getResources().getString(R.string.select_image)), 1);
Now my problem is that I've got to choose an application everytime again. I would like to be able to select the default application for this action. For example I don't want always be asked which Gallery I would like to use, I would like to be able to select one standard gallery which will be used as default.
EDIT: I would like to have these buttons at the dialog's button which allows the "always" or "just once" selection.
Any suggestions? Thanks in advance.
Upvotes: 0
Views: 1026
Reputation: 1006674
I would like to be able to select the default application for this action.
If you get rid of Intent.createChooser()
, and instead just call startActivityForResult()
with your Intent
, the user will have the option of setting a default choice for this Intent
structure, if they have not done so already.
Upvotes: 1