Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8719893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:54:27+00:00 2026-06-13T06:54:27+00:00

I know I’m over looking this or over thinking this but I can not

  • 0

I know I’m over looking this or over thinking this but I can not seem to figure out how to launch the link of an rss feed when the user clicks it. I’m using a DOM Parser to parse the xml file into a listview and get all the info from the xml file. The problem I’m having is parsing it into a Custom WebActivity that i have that should load a webview client that i have as well. Here is the code i’m working with.

Main Activity

 public class CustomizedListView extends Activity {
// All static variables
static final String URL = "http://treymorgan.net/feed";
// XML node keys
static final String KEY_ITEM = "item"; // parent node 
static final String KEY_ID = "id";
static final String KEY_TITLE = "title";
static final String KEY_PUB_DATE = "pubDate";
static final String KEY_LINK = "guid";

ListView list;
LazyAdapter adapter;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>();

    XMLParser parser = new XMLParser();
    String xml = parser.getXmlFromUrl(URL); // getting XML from URL
    Document doc = parser.getDomElement(xml); // getting DOM element

    NodeList nl = doc.getElementsByTagName(KEY_ITEM);
    // looping through all song nodes <song>
    for (int i = 0; i < nl.getLength(); i++) {
        // creating new HashMap
        HashMap<String, String> map = new HashMap<String, String>();
        Element e = (Element) nl.item(i);
        // adding each child node to HashMap key => value
        map.put(KEY_ID, parser.getValue(e, KEY_ID));
        map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
        map.put(KEY_PUB_DATE, parser.getValue(e, KEY_PUB_DATE));
        map.put(KEY_LINK, parser.getValue(e, KEY_LINK));

        // adding HashList to ArrayList
        songsList.add(map);
    }


    list=(ListView)findViewById(R.id.list);

    // Getting adapter by passing xml data ArrayList
    adapter=new LazyAdapter(this, songsList);        
    list.setAdapter(adapter);


    // Click event for single list row
    list.setOnItemClickListener(new OnItemClickListener() {

EDIT : This is the section of code i’m haveing trouble with … the onItemClick method to send the url from the rss feed to the webview activity so that it can be viewed in app and not through the native browser on the device

        @Override
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
            Intent intent = new Intent(CustomizedListView.this, WebviewActivity.class);  
            Bundle b = new Bundle();
            intent.putExtra("KEY_LINK", b);
            startActivity(intent); 



             }

    });
}   
 }

here is my Webview activity

 public class WebviewActivity extends Activity{
  private WebView webview;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.webview);

    Bundle b = getIntent().getExtras(); 
    String KEY_LINK = b.getString("KEY_LINK");

    webview = (WebView) findViewById(R.id.webView1);
    webview.setWebViewClient(new MyWebViewClient(this));
    webview.getSettings().setAppCacheEnabled(false);
    webview.getSettings().setBuiltInZoomControls(true);
    webview.setInitialScale(1);
    webview.loadUrl(KEY_LINK);



  }


       }

So basicly, what I’m wanting to do is String the KEY_GUID to the WebviewActivity and I can’t seem to figure out how to recive the string from one activity to the other. Thanks in advance for any help

EDIT: OK I’ve worked on this a while and I have updated the code i’m using that is relevent to this issue. Now I have no errors and when i click an item it will open the WebviewActivity but it does not load the website nor does it attach my webview client to it either. Can anyone help me figure this out?

EDIT:
when i load the code like this:

 @Override
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {

            Intent intent = new Intent(CustomizedListView.this,    WebviewActivity.class);  
            Bundle b = new Bundle();
            intent.putExtra("b", "http://www.google.com" );
            startActivity(intent); 

It opens the webview activity and loads google up just fine. So maybe the problem i am having now is how to get the link that i need from my DOM parser. Anyone have any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:54:28+00:00Added an answer on June 13, 2026 at 6:54 am

    Ok here is the answer to my question i asked. This worked great for me and did exactly as i wanted. Here is the working code for it

     public class CustomizedListView extends Activity {
    // All static variables
    static final String URL = "http://treymorgan.net/feed";
    // XML node keys
    static final String KEY_ITEM = "item"; // parent node 
    static final String KEY_ID = "id";
    static final String KEY_TITLE = "title";
    static final String KEY_PUB_DATE = "pubDate";
    static final String KEY_LINK = "link";
    
    ListView list;
    LazyAdapter adapter;
    
    ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>();
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
    
        final ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>();
    
        XMLParser parser = new XMLParser();
        String xml = parser.getXmlFromUrl(URL); // getting XML from URL
        Document doc = parser.getDomElement(xml); // getting DOM element
    
        NodeList nl = doc.getElementsByTagName(KEY_ITEM);
        // looping through all song nodes <song>
        for (int i = 0; i < nl.getLength(); i++) {
            // creating new HashMap
            HashMap<String, String> map = new HashMap<String, String>();
            Element e = (Element) nl.item(i);
            // adding each child node to HashMap key => value
            map.put(KEY_ID, parser.getValue(e, KEY_ITEM));
            map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
            map.put(KEY_PUB_DATE, parser.getValue(e, KEY_PUB_DATE));
            map.put(KEY_LINK, parser.getValue(e, KEY_LINK));
    
            // adding HashList to ArrayList
            songsList.add(map);
        }
    
    
        list=(ListView)findViewById(R.id.list);
    
        // Getting adapter by passing xml data ArrayList
        adapter=new LazyAdapter(this, songsList);        
        list.setAdapter(adapter);
    
    
        // Click event for single list row
        list.setOnItemClickListener(new OnItemClickListener() {
    
            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                    int position, long id) {
    
                Intent intent = new Intent(CustomizedListView.this, WebviewActivity.class);  
                new Bundle();
                intent.putExtra( "b", songsList.get(position).get(KEY_LINK));
                startActivity(intent); 
    
    
    
                 }
    
        });
    }   
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I KNOW I did this in WP7 (not WP7.1) and I can't figure out
Know this might be rather basic, but I been trying to figure out how
I know you can not set a key value dynamically, but what about the
I know this is kind of easy question but i cant seem to find
I know that this has been discussed thousand times but I still cannot figure
I know that there has been one question about this but it is not
I know that this sort of question has been asked here before, but still
i know this is a stupid question but i d'ont know how to do
I know theres a lot of posts about redirects but this is a little
I know this is a very simple question for you experts,but please forgive me.Im

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.