I’m useing a listView to list some webpages. I’d like to have the webpage open when it’s clicked on in the listView.
I’m trying to get some of the “text” from the list item sent to the uri for opening the webpage. I hope this makes sence to everyone.
I’m just learning so any help would be great.
Something like this?
Uri uri =Uri.parse(***text form list item selected***)
Thanks,
-Nick
You are going to want to implement an
OnItemClickListener()for yourListViewand use the information in yourAdapterto construct your Uri. From there you can launch an activity with your Uri and the action asACTION_VIEWto open a webpage.Assuming you have your list populated properly you should be looking at attaching an
OnItemClickListenerthat looks roughly like this.