问题
I have an app on the appworld and I would like to add a link to it in my app so that people can more easily rate it. Normally on the android market I would do something like:
Uri uri = Uri.parse("market://details?id=com.example.test");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Or on Amazon I would do:
Uri uri = Uri.parse("http://www.amazon.com/gp/mas/dl/android?p=com.example.test");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
But when I try the following it does not work:
Uri uri = Uri.parse("appworld://content=000000");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
It pops up a browser and then I get a message about not being able to do it or something. I also tried to launch to the appworld website page but appworld isn't grabbing it. What would be to correct way to handle this link?
回答1:
The normal market:// link should actually work.
回答2:
The normal market://
URI didn't work for me. The BlackBerry World app would always show the error:
There was a problem loading this Page due to a network error.
The fix was to detect when my app was running on a BlackBerry device then to use a different URI:
if (java.lang.System.getProperty("os.name").equals("qnx")){
marketUri = "appworld://content/1234567"
} else {
//normal Google Play URI
}
You can get your content ID from the BlackBerry World Vendor Portal by clicking on the 'edit' link next to your app. The ID is shown in the first field.
来源:https://stackoverflow.com/questions/13291002/appworld-market-link-in-android-runtime