如何连接文本视图到一个网站? [英] How to connect the text view to a website?
问题描述
我是新来的Android和我创建了一个应用程序,它使用谷歌API的地方,并列出了一些百货公司。
我已经在单击百货公司的名称我开始其访问,我创建给予推荐或折扣的产品在特定的存储数据库的新活动的上榜点击。
我需要的是,当我点击百货商店我希望应用程序重定向到商店的网站,列出所有的推荐或折扣的产品在特定的商店的名字。
list.setOnItemClickListener(新OnItemClickListener(){
公共无效onItemClick(适配器视图<>为arg0,查看ARG1,INT位置,
长ARG3){
字符串URL =网址[位置]
开放的我们的uri = Uri.parse(URL);
意向意图=新的意图(Intent.ACTION_VIEW,URI);
startActivity(意向);
}
});
在这里,你必须把所有部门的网址在一个单独的阵列名为网址
Hi i am new to android and i have created a app which uses the google places api and lists a few department stores.
I have made the list clickable upon clicking the name of the department store i am starting a new activity which accesses a database that i created to give the recommended or discount products in that particular store.
What i need is that when i click on the name of the department store i want the app to redirect to the stores website and list all the recommended or discount products in that particular store.
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3) {
String url=urls[position];
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
Here you have to place all department urls in a seperate array called urls
这篇关于如何连接文本视图到一个网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!