Questions tagged [android-implicit-intent]

An implicit intent specifies an action that can invoke any app on the device able to perform the action. Using an implicit intent is useful when your app cannot perform the action, but other apps probably can and you'd like the user to pick which app to use.

From the official Android documentation :

An implicit intent specifies an action that can invoke any app on the device able to perform the action. Using an implicit intent is useful when your app cannot perform the action, but other apps probably can and you'd like the user to pick which app to use.

For example, if you have content you want the user to share with other people, create an intent with the ACTION_SEND action and add extras that specify the content to share. When you call startActivity() with that intent, the user can pick an app through which to share the content.

Caution: It's possible that a user won't have any apps that handle the implicit intent you send to startActivity(). If that happens, the call will fail and your app will crash. To verify that an activity will receive the intent, call resolveActivity() on your Intent object. If the result is non-null, then there is at least one app that can handle the intent and it's safe to call startActivity(). If the result is null, you should not use the intent and, if possible, you should disable the feature that issues the intent.

// Create the text message with a string
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage);
sendIntent.setType(HTTP.PLAIN_TEXT_TYPE); // "text/plain" MIME type

// Verify that the intent will resolve to an activity
if (sendIntent.resolveActivity(getPackageManager()) != null) {
    startActivity(sendIntent);
}

Note: In this case, a URI is not used, but the intent's data type is declared to specify the content carried by the extras.

When startActivity() is called, the system examines all of the installed apps to determine which ones can handle this kind of intent (an intent with the ACTION_SEND action and that carries "text/plain" data). If there's only one app that can handle it, that app opens immediately and is given the intent. If multiple activities accept the intent, the system displays a dialog so the user can pick which app to use.

106 questions
0
votes
1 answer

Android: Does a bitmap created by my app have to be stored and scanned before I can pass it as an implicit intent to other apps?

Introduction and background Hi, I have a bitmap created by my application, I wish for this bitmap to be sent to any apps that can handle the mime type "image/png" and the action ("ACTION_SEND"). Basically, allow the bitmap image to be sent to…
0
votes
1 answer

Calling Main Activity using Implicit Intents (specifying action and category)

I'm trying to call main activity using implicit intents. I give both action and category in intent but before starting the activity android system gives me a list of applications to select from for opening the activity. Code snippet I am using to…
Kany
  • 45
  • 3
  • 9
0
votes
1 answer

Does sinch SDK use implicit intent in their service?

In brief I just want a simple answer for my question. does sinch SDK use implicit intent in their service ?
Kareem Essam Gaber
  • 643
  • 1
  • 6
  • 16
0
votes
0 answers

how to trigger particular app in android by default

Say if, I want to restore an .vcf file / send an email from my app and i use Implicit Intents to achieve it. But, it pops up some options like (for vcf files: Editor, people. for email: gmail, mail). I want only one application to be opened by…
0
votes
2 answers

How can I get a number placed in a text message on Android?

I want to add a feature to my app that when I touch the number in a message, the user can decide to send the number to my app or Android Dialer. For example my friend send me a code and i want to use this code for special ussd code that my app run…
Mehdi
  • 1,260
  • 2
  • 16
  • 36
0
votes
1 answer

implicit intent for camera capture in android

I am facing a very weird issue. I have an implicit intent for opening the default camera. There is an image view with a camera icon, which when clicked opens the default camera. Sometimes on clicking the imageview, opens the camera but sometimes it…
0
votes
0 answers

Specifing return activity for implicit intent

I have a implicit intent where it opens a website and after they finish using the website, I want it to get open a particular activity, irrespective of their parent activity. I just want to know how to make this happen.
Naresh
  • 3,174
  • 1
  • 17
  • 22
0
votes
1 answer

Error Loading image from asset folder through Implicit Intent by using Phone's Image viewer

I am trying to display different London Tube maps through mobile's camera image viewer app by using implicit Intent. I had tube_map.gif image file in asset folder but when i try to load this file, app displays unable to find item. I think the file…
-1
votes
1 answer

Implicit Intent - java.lang.NullPointerException: Attempt to invoke virtual method on a null object reference

java.lang.NullPointerException: Attempt to invoke virtual method 'android.app.ActivityThread$ApplicationThread android.app.ActivityThread.getApplicationThread()' on a null object reference I am getting this error when I am trying to open a link…
Levi
  • 187
  • 2
  • 17
-1
votes
2 answers

How can we share the Icon image with dynamic content overlap on it through implicit intent?

Here points, streak and level are dynamic I want to share this whole image with the dynamic text of points, streak and level with implicit intent. How can I do this please help me out?
-1
votes
1 answer

CMS url not opening in browser via implicit intent

I am trying to open news feed which has url extension .cms Instead when tried simple url e.g. http://www.google.com/, it works as expected but not for .cms page. I don't want to add my own WebView. I am pretty sure that .cms is causing the problem…
-1
votes
1 answer

Android - Passing integer value from One Activity to Android Native implicit intent and recive to another activity

I have One Activity name AlbumPicker. In that activity I am calling below code on Button click. Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); intent.putExtra("Example",…
-1
votes
1 answer

Android: How to send an ics File to apps on the Phone

I am creating an .ics File in my Activity. I want to send the created .ics File to a calendar app on the phone, so the app can import the events. Here is my code for the Intent: `Intent intent = new Intent(Intent.ACTION_SEND); …
-1
votes
4 answers

Open my app from a link

In my app the server send this link: appname://veryfy?email=test@mail.com&token=asdf-asdf-asdf-xcfghfgh but is it possible to get the values like email= test@mail.com and the token = sdfdkgdkgjgfd. So far I've only added this intent filter inside…
-1
votes
1 answer

why do we need intent filter in android?

This might be a very stupid question, but I am not quite clear on the answer. My implicit intent contains an action, data & category (optional), which I pass while sending the intent either through startActivity or startService. something like…