Android:打开tripadvisor应用程序

Android:打开tripadvisor应用程序,android,Android,是否有一种方法可以从指定餐厅的另一个应用程序打开tripadvisor应用程序,就像我们在Facebook页面或play store上所做的那样 像这样的事情: context.getPackageManager().getPackageInfo("/*tripadvisor package*/", 0); return new Intent(Intent.ACTION_VIEW,Uri.parse("trip://resturant/313689422066566")); 我

是否有一种方法可以从指定餐厅的另一个应用程序打开tripadvisor应用程序,就像我们在Facebook页面或play store上所做的那样

像这样的事情:

context.getPackageManager().getPackageInfo("/*tripadvisor package*/", 0);
        return new Intent(Intent.ACTION_VIEW,Uri.parse("trip://resturant/313689422066566"));
我试着在互联网上搜索,但没有发现任何有用的东西。有人知道吗?

试试看

Intent i;
PackageManager manager = getPackageManager();
try {
 i = manager.getLaunchIntentForPackage("app package name");
if (i == null)
    throw new PackageManager.NameNotFoundException();
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
   } 
catch (PackageManager.NameNotFoundException e) {
}

我找到了一个方法。。。如果你想写:

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(link_tripadvisor));
                startActivity(browserIntent);

它让您有机会选择是使用浏览器还是应用程序打开它

问题是我不知道tripadvisor软件包的名称,即使我知道,我也不知道如何创建一个URL来显示想要的餐厅你有哪些关于餐厅的信息?我有tripadvisor页面的链接我认为这是不可能的。。。因为他没有文档,我也检查了Tripadvisor API,所以您需要许可证才能使用它。你可能想加载一个简单的webview?是的…我怀疑这…我之前也检查过api…是的,我会选择webview谢谢:)