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

How do i import a file from my system downloads folder into the raw directory

I am downloading a .csv file from the internet on my Android phone. This isn't done through my app. However, I want to import this file from the system downloads folder into my raw directory. I select a button in the action bar and call the method…
0
votes
1 answer

Reading gallery folders using Implicit intent

I am implementing an android app, which will synchronize images from selected folder to server (as Google Photo). I want that user will select folder by clicking on button. I can achieve this by creating my own view. But, if implicit intent can any…
0
votes
1 answer

send email using implicit intent

Below is the java and xml file for sending email. Please verify the code. I have registered the button still it isn't working. ERROR: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe2d19220, error=EGL_SUCCESS.Skipped 37 frames! The application…
Honey
  • 19
  • 10
0
votes
0 answers

Implicit intent doesn't work with my app

I have two applications, the first one send an implicit intent to view a link and the second one named "MyBrowser" receives it. But when I install both apps on my phone (API level 23), the app chooser only display the Internet (default application…
0
votes
1 answer

How to use an implicit Intent to give choices to perform a certain action?

Like getting an image. I want to give users the choice to access either the camera, gallery or any other app which can return an image.
0
votes
0 answers

OK Button not returning to Activity after using Implcit Intent for Camera

this question has been asked on this platform but none of them helped me. So this application has a button Click Photo with a callback to onPhotoClicked(). I have mentioned the WRITE_EXTERNAL_STORAGE permission in the Manifest. After clicking the…
0
votes
1 answer

What does it mean when an activity with intent-fitler just has action_MAIN and no category mentioned?

I understand that to resolve implicit intents we need intent-filters with action and category_default. But my question is what if an activity declared with intent filter with action, but no category. 1a) What does this intent filter does and…
sofs1
  • 3,834
  • 11
  • 51
  • 89
0
votes
1 answer

how to move from one app to another by implicit intent?

I'm new in android so please help me how to it. im trying to do it by using custom intent filter. Manifest file:
0
votes
0 answers

Application blacks out and stops responding when returning back from another app

I am developing this app that contains a webview and also an actionbutton on its Toolbar that would allow the user to send a text message to the a number. Thing is im using an implicit intent and Intent.Action_View to be able to send a text message…
Shoaib Anwar
  • 1,555
  • 12
  • 26
0
votes
1 answer

Unable to launch kakao talk from implicit intent

Im willing to open KakaoTalk using implicit intent. Following is my code. PackageManager pm = getActivity().getPackageManager(); try { Intent waIntent = new Intent(Intent.ACTION_SEND); …
user6038900
0
votes
0 answers

How to send Image in android from my app to other app?

I wants to send an image stored in the drawable folder to some other app using ACTION_SEND ,my code is given below: if(view.getId()==R.id.sendimage) { Uri…
0
votes
1 answer

Android Intent Application Crashing

I'm trying to create a very small application for a project. I have two buttons that call applications with implicit intents, but whenever I press either, the application (the one I'm creating) keeps crashing. What's going on? Here's the…
f3d0r
  • 541
  • 3
  • 12
  • 27
0
votes
2 answers

What kind of intents should I use to save the bug report generated by android device

How can I get my app listed in the app chooser screen when sharing the bug reported generated by the android device. The bug report which can be generated using the USB debugging developers options. I have tried adding all the mime types in the data…
Rakshith
  • 1
  • 1
0
votes
1 answer

Android Intent Filter to receive image files is only working in some apps

I'm experimenting with android development. As an exercise I want to create an app that is able to receive images shared by other apps. I'm testing the app on my phone. If i share an image in WhatsApp everything works as expected. My app is listed…
0
votes
2 answers

Android Intent for deep-linking to Deezer Search

I am trying to perform a search on Deezer by sending the following intent: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.deezer.com/search/" + query)); this.startActivity(intent); In a previous version the web browser opened…
Markus
  • 1,649
  • 1
  • 22
  • 41