1

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 1

1

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);
Sign up to request clarification or add additional context in comments.

4 Comments

i need to parse the url from the xml i.e the url is different for every list item
"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
so a onClickListener for the Intent - Uri.parse,
but for the Uri would the web address be TAG_URI??

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.