Android - Linking to Your Products 開啟APP安裝頁面



Reference:

http://developer.android.com/intl/zh-tw/distribute/tools/promote/linking.html


Example:

final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
try {
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}

留言

這個網誌中的熱門文章

Android - 輸入字串排除 使用InputFilter

Android - OkHttp3連線 post應用