Thinking in Google doc-interactions between different apps

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.