从我的应用程序打开应用程序的简单方法是什么?我正在构建的应用程序我希望人们在商店里打开Foursquare进行签入。我认为他们可以打开网页。但是我想打开Foursquare应用...
four.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
// TODO Auto-generated method stub
Uri uriUrl = Uri.parse("https://m.foursquare.com/nationalcleaners");
Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);
startActivity(launchBrowser);
}
});
用对我有用的东西更新了我的问题...
如果用户单击按钮时将其安装在用户手机上,它将为用户提供使用浏览器或foursquare应用程序的选择。选择浏览器或应用程序后,它将在foursquare中显示搜索,您可以让它在下面的代码的“放置您要搜索的内容”部分中搜索您要Foursquare搜索的内容。
这就是我的设置方式,并且可以正常工作。
按钮四=(按钮)findViewById(R.id.foursq);
four.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
// TODO Auto-generated method stub
Uri uriUrl = Uri.parse("http://m.foursquare.com/search?q=Place what your searching for hear");
Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);
startActivity(launchBrowser);
}
});
最佳答案
看看Foursquare documentation用于Android的意图。似乎您可以使用http URL作为意图URI来启动本机应用程序(如果未安装,则浏览器将打开给定的URL)。
关于android - 从我的应用程序打开Foursquare应用程序,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10574997/