Android Intent edit

Implicit and Explicit Intents

An explicit intent is used for starting an activity or service within the same application package. In this case the name of the intended class is explicitly mentioned:

Intent intent = new Intent(this, MyComponent.class);
startActivity(intent);

However, an implicit intent is sent across the system for any application installed on the user’s device that can handle that intent. This is used to share information between different applications.

Intent intent = new Intent("com.stackoverflow.example.VIEW");

//We need to check to see if there is an application installed that can handle this intent
if (getPackageManager().resolveActivity(intent, 0) != null){ 
    startActivity(intent);
}else{
    //Handle error
}

More details on the differences can be found in the Android Developer docs here: Intent Resolution

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Table Of Contents
6 Intent
39 ACRA
64 Menu
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close