How can I change my code to put an option in my application which give the user the option to choose either a single for a couple of photos to upload in their profile?
At the moment I'm using the following code ....... ,but it doesn't allow the user to choose a single image and its limits is at least 2 photos
So how should I change my code?
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "select images"), CODE_MULTIPLE_IMG_GALLERY);
Related
I want to access notification settings via intent on my application, how can I achieve this?
Check the following image
Intent intent = new Intent(); intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
intent.putExtra("app_package", getPackageName());
intent.putExtra("app_uid", getApplicationInfo().uid);
this is my sample codes but it gives me different output. What I want to see is a list of application exactly on the third image.
i am developing a app in which i want to show only apk files to user so he could select only .apk files from file manager. I found several answers but rest didnt work for me. i tried intent.setType("application/vnd.android.package-archive" Infact i am unable to restrict user even only to images.
here is my code
private void showFileChooser() {
Intent intent = new Intent();
//sets the select file to all types of files
intent.setType("application/vnd.android.package-archive");
//allows to select data and return it
intent.setAction(Intent.ACTION_GET_CONTENT);
//starts new activity to select file and return data
startActivityForResult(Intent.createChooser(intent, "Choose File to Upload.."), PICK_FILE_REQUEST);
}
Photo picker intent:
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("image/*");
startActivityForResult(photoPickerIntent, SELECT_PHOTO);
The text, shown below, currently says "Complete action using Photos". Is there a way to change this to something custom?
It's simple. The answer is No. Also in won't always be "with Photos", it will depend on most used(or recent) app for this kind of Action.
Lil update
You can use some other way of doing this.
Intent.createChooser(yourIntent, "Open via ..." /*your text goes here*/)
This will look differently, but will have your text
Use like this
this.startActivity(Intent.createChooser(emailIntent, "Send mail via ..."));
I'm trying to pick a file via an Intent.
What I tryed till now is this:
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
startActivityForResult(intent, FILE_SELECT_CODE);
But with this, I can only pic Photos with the galery app.
My goal is to pic ANY file via the standard file manager of Android/Samsung.
This didn't work either:
String manufactures = android.os.Build.MANUFACTURER;
if(manufactures.equalsIgnoreCase("samsung"))
{
Intent intent = new Intent("com.sec.android.app.myfiles.PICK_DATA");
intent.putExtra("CONTENT_TYPE", "*/*");
startActivityForResult(intent, FILE_SELECT_CODE);
}
Thx for your help!
My goal is to pic ANY file via the standard file manager of Android/Samsung.
Android does not have a "standard file manager".
If your minSdkVersion is 19 or higher, you are welcome to use the Storage Access Framework (e.g., ACTION_OPEN_DOCUMENT), which is the closest thing that Android now has to a "standard file manager".
Otherwise, you are limited to whatever ACTION_GET_CONTENT-supporting apps that the user has installed, or creating your own file-selection UI, or using one of many existing libraries for selecting files.
I want to create a sharing button via some applications only.
right now I`m using this code:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, "App Name");
intent.putExtra(Intent.EXTRA_TEXT, "Check out this cool app http://market.android.com/details?id=com.example.yourpackagename");
Intent chooser = Intent.createChooser(intent, "Tell a friend about App Name");
startActivity(chooser);
But it opens a huge window with all the apps installed at the device. I want to show only chosen options (Facebook, Whatsapp, Gmail).
Thank you.
Have a look at this answer, I would suggest going with it : https://stackoverflow.com/a/9755553/1542720
Some other workarounds/solutions :
http://hkdevtips.blogspot.in/2013/02/customize-your-actionchooser-intent.html
Custom filtering of intent chooser based on installed Android package name