I have successfully parsed an XML file into a custom ListView, but how would I parse a URL from the XML into a button so when clicked takes the user to webpage?
1 Answer
You can simply use the following Intent replacing obviously my wordpress site :)
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.alchemiasoft.wordpress.com"));
startActivity(intent);
4 Comments
SquiresSquire
i need to parse the url from the xml i.e the url is different for every list item
Simone Casagranda
"I have successfully parsed an XML..." seems that you have just parsed the xml ;) So if you want to attach a different action for every button you have to set the correct onClickListener on the button of every ListItem
SquiresSquire
so a onClickListener for the Intent - Uri.parse,
SquiresSquire
but for the Uri would the web address be TAG_URI??