android-intent-chooser

Android 11 (R) return empty list when querying intent for ACTION_IMAGE_CAPTURE

柔情痞子 提交于 2021-02-07 11:55:40
问题 Device: Emulator pixel 3a - Android 11 Code: final List<Intent> cameraIntents = new ArrayList<Intent>(); final Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); final List<ResolveInfo> listCam = context.getPackageManager().queryIntentActivities(captureIntent, 0); When using: targetSdkVersion 30 compileSdkVersion 30 listCam size is 0 and when changing to: compileSdkVersion 29 listCam size is 1 - as it should be. Using the following code: val captureIntent = Intent(MediaStore

Callback for Custom Item in Intent Chooser Screen

醉酒当歌 提交于 2020-04-07 05:43:39
问题 My use case is to download an image from a Custom Download option from Intent Chooser. I understand that I can add the custom option by adding some code like below : Intent share = new Intent(Intent.ACTION_SEND); share.setType("text/plain"); share.putExtra(Intent.EXTRA_TEXT, message); Intent addIntent = ;//whatever you want Intent chooser = new Intent(Intent.ACTION_CHOOSER); chooser.putExtra(Intent.EXTRA_INTENT, share ); chooser.putExtra(Intent.EXTRA_TITLE, "title"); Intent[] intentArray =

how can you share location same like whatsapp in android with chooser dialog?

安稳与你 提交于 2020-01-08 01:50:28
问题 I want "share location" functionality same like whatsapp in my current application. Now to open chooser dialog i used below mentioned code. public static void showFileChooser(Activity activity, Fragment fragment, boolean isAllowMultiple) { try { File imageStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "demo"); if (!imageStorageDir.exists()) { imageStorageDir.mkdirs(); } File file = new File(imageStorageDir + File.separator + "i" + String

how can you share location same like whatsapp in android with chooser dialog?

孤街浪徒 提交于 2020-01-08 01:50:25
问题 I want "share location" functionality same like whatsapp in my current application. Now to open chooser dialog i used below mentioned code. public static void showFileChooser(Activity activity, Fragment fragment, boolean isAllowMultiple) { try { File imageStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "demo"); if (!imageStorageDir.exists()) { imageStorageDir.mkdirs(); } File file = new File(imageStorageDir + File.separator + "i" + String

Custom chooser activity: SecurityException UID n does not have permission to content:// uri

人盡茶涼 提交于 2020-01-01 12:06:34
问题 I'm building a Chooser app that replaces the native Android Share dialog. It works fine except when I try to share an image from Chrome via longpress image > share image. I found that Google+ doesn't catch the exception (it crashes) so I can have a look at it via Logcat: Do an image search on Google. Select an image (this should show the preview) Longpress the image Choose "Share image" My chooser activity pops up Select Google+ Google+ crashes with this error: java.lang.SecurityException:

Custom chooser activity: SecurityException UID n does not have permission to content:// uri

主宰稳场 提交于 2020-01-01 12:05:06
问题 I'm building a Chooser app that replaces the native Android Share dialog. It works fine except when I try to share an image from Chrome via longpress image > share image. I found that Google+ doesn't catch the exception (it crashes) so I can have a look at it via Logcat: Do an image search on Google. Select an image (this should show the preview) Longpress the image Choose "Share image" My chooser activity pops up Select Google+ Google+ crashes with this error: java.lang.SecurityException:

Navigation with Waze and Google Maps using Intent.createChooser shows Waze icon twice

纵然是瞬间 提交于 2019-12-19 18:24:13
问题 I'm creating this question after finding the answer, I was not sure about the etiquette, but it seems to be OK (plus, I see now there's a built-in option). The problem was as described in the title, we created an intent chooser using code that resembles this: String url = "waze://?ll=" + latitude + ", " + longitude + "&navigate=yes"; Intent intentWaze = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); String uriGoogle = "google.navigation:q=" + latitude + "," + longitude; Intent

Navigation with Waze and Google Maps using Intent.createChooser shows Waze icon twice

最后都变了- 提交于 2019-12-19 18:23:21
问题 I'm creating this question after finding the answer, I was not sure about the etiquette, but it seems to be OK (plus, I see now there's a built-in option). The problem was as described in the title, we created an intent chooser using code that resembles this: String url = "waze://?ll=" + latitude + ", " + longitude + "&navigate=yes"; Intent intentWaze = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); String uriGoogle = "google.navigation:q=" + latitude + "," + longitude; Intent

Android — intent chooser for whatsapp and sms only

南笙酒味 提交于 2019-12-12 01:44:15
问题 I want to create an IntentChooser who offer to share text only via SMS or WhatsApp. Here is my code to share via WhatsApp: Intent localIntent = new Intent(Intent.ACTION_SEND); localIntent.setType("text/plain"); localIntent.setPackage("com.whatsapp"); if (localIntent != null) { localIntent.putExtra(Intent.EXTRA_TEXT, "Hi there! I'm using this app"); startActivity(Intent.createChooser(localIntent, "Hi there! I'm using this app"); } I need to add to this also sharing with SMS. How can I do it?

Intent image share-file format not supported

偶尔善良 提交于 2019-12-11 00:39:54
问题 I'm unable to share image to social media when i clicked on share button. It showed the Toast File format not supported public void onBindViewHolder(final ViewHolder holder, int position) { upload = uploads.get(position); holder.textViewName.setText(upload.getName()); final String imageUrl=upload.getUrl(); Glide.with(context).load(imageUrl).into(holder.imageView); final Uri imageUri=Uri.parse("https://firebasestorage.googleapis.com/v0/b/memories-project.appspot.com/o/uploads