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.
[Java]View Plaincopy
- 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);
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:
[Java]View Plaincopy
- Intent sendintent = 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