问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/14473242/how-to-connect-the-text-view-to-a-website