如何从我的应用程序打开ola应用程序?

时间:2016-11-02 13:25:26

标签: android

从我的应用程序中打开ola应用程序的String uri是什么?

我试过这个

try {
    pm.getPackageInfo("com.olacabs.customer",PackageManager.GET_ACTIVITIES);
} catch (PackageManager.NameNotFoundException e) {
    try {
        getContext().startActivity(new Intent(Intent.ACTION_VIEW,    Uri.parse("market://details?id=com.olacabs.customer")));
    } catch (android.content.ActivityNotFoundException anfe) {
        getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=com.olacabs.customer")));
    }
}

1 个答案:

答案 0 :(得分:0)

repeat.for

如果已经安装了Ola应用程序,那么您可以像这样调用Launcher

<li repeat.for="message of chat.messages">
  <compose  view-model.bind="getMessageViewFromMessage(message) & oneTime"
            model.bind="message & oneTime"
            containerless>
  </compose>
</li>

最终代码如下: 最终代码:

  Uri uri = Uri.parse("market://details?id=com.olacabs.customer");
    Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);

    goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
                    Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
                    Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
    try {
        startActivity(goToMarket);
    } catch (ActivityNotFoundException e) {
        startActivity(new Intent(Intent.ACTION_VIEW,
                Uri.parse("http://play.google.com/store/apps/details?id=com.olacabs.customer")));
    }