I have completed the Hello Views tutorial from android developers (http://developer.android.com/resources/tutorials/views/hello-listview.html)
I understood the concept, but it doesn't fit my project. I'm trying to make a list and when clicked I want it to open a webView with d开发者_JAVA技巧ifferent URL's depending of which item is clicked.
I can't figure out which code I need to use...
you just need to set up an OnItemClickListener for the listView:
http://developer.android.com/reference/android/widget/AdapterView.OnItemClickListener.html
Declare a new Webview at the top then within this OnItemClickListener set up a switch statment to assign the URL to the WebView depending on which item in the ListView was clicked. Then out side of the switch statment, but inside the OnItemClickListener, call on the WebView.
Hope this helps.
精彩评论