1. Implicit intent
How to pass the value I will not elaborate, say some ordinary people do not know it.
1) Verify There is a app to Receive the Intent (determine if an app responds with intent)
You should always include averification step before invoking an intent.
Caution: If you invoke an intent and there are no appavailable on the device that can handle the intent, your app would crash. (No Apply the processing intent, and the app will hang out. )
Because you can't guarantee that every phone has the app you need!
PackagemanagerPackagemanager= getPackageManager()
;
ListActivities=Packagemanager.queryintentactivities(Intent,
Packagemanager.match_default_only);
BooleanIsintentsafe=Activities.size() > 0;
If isIntentSafe
true
is and then at least one app would respond tothe intent. If it is
false
, then there aren ' t any apps to handle the intent.
2)
This article is from the "line of the World" blog, please be sure to keep this source http://4259297.blog.51cto.com/4249297/1715709
Thinking in Google doc-interactions between different apps