Android calls installed market for software scoring feature implementation

Source: Internet
Author: User

exntends:http://blog.csdn.net/wangfayinn/article/details/10351655

In the project to have a software scoring function, a very common, very simple function, but it cost me a lot of effort. The effects you need to achieve are as follows:

Would have thought that the general software will have "to score", "pro, to a favorable comment" such a function, but search on the internet did not search, asked three groups plus 5 children's shoes, analysis log, anti-compilation look at the source, finally found the URI, get him really not easy ah.

try {
Uri uri = uri.parse ("market://details?id=" + getpackagename ());
Intent Intent = new Intent (Intent.action_view, URI);
Intent.addflags (Intent.flag_activity_new_task);
StartActivity (Intent);
} catch (Exception e) {
Showtoast ("Application Market not Installed");
E.printstacktrace ();
}

With the above code, you can list all the app markets installed on your phone (e.g. Google player, pea pods, 360 mobile phone assistants, etc.) and let you choose.

Add a fringe benefit, and put the code for the call to share, lest you look around for it later:

New Intent ();  Sendintent.setaction (intent.action_send);  Sendintent.settype ("text/*");  Sendintent.putextra (Intent.extra_text, Contentedittext.gettext (). toString ());  StartActivity (sendintent);  

Android calls installed market for software scoring feature implementation

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.