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 7815041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:23:21+00:00 2026-06-02T05:23:21+00:00

In my code i want to show webview and textview in a list from

  • 0

In my code i want to show webview and textview in a list from Rss feed.Here is the code:

 public class VediolistfetchActivity extends Activity {
        /** Called when the activity is first created. */

        ListView Feed;
        URL url;
        String[] title = { " " }, image={""};
        ArrayAdapter<String> adapter;
        ArrayList<Home> homes = new ArrayList<Home>();


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

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


            try {

                SAXParserFactory saxPF = SAXParserFactory.newInstance();
                SAXParser saxP = saxPF.newSAXParser();
                XMLReader xmlR = saxP.getXMLReader();

                url = new URL("http://www.powergroupbd.com/sweethome/videolist.xml");

                RSSHandler myXMLHandler = new RSSHandler();
                xmlR.setContentHandler(myXMLHandler);
                xmlR.parse(new InputSource(url.openStream()));

                ArrayList<String> GOTTitle = myXMLHandler.gotTitle();
                ArrayList<String> GOTImage = myXMLHandler.gotImage();

                title = new String[GOTTitle.size()];
                image = new String[GOTImage.size()];

                for (int i = 0; i < GOTTitle.size(); i++) {
                    Home home = new Home();
                    title[i] = GOTTitle.get(i).toString();
                    image[i] = GOTImage.get(i).toString();
                    home.openclose=GOTTitle.get(i);
                    home.imagehome=GOTImage.get(i);
                    homes.add(home);
                }

                HomeAdapter homeAdapter = new HomeAdapter(
                        VediolistfetchActivity.this, R.layout.list_catagory,
                        homes);

                Feed.setAdapter(homeAdapter);

            }

            catch (Exception e) {
                Toast.makeText(getApplicationContext(),
                        "Something Went Wrong, Please check your net connection",
                        Toast.LENGTH_LONG).show();
            }
        }
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            // TODO Auto-generated method stub

            Log.i("List Click", "Yes");
            String dtlHomeTitle = Feed.getItemAtPosition(arg2).toString();
            Log.i("title", dtlHomeTitle);


        }


    }

Here is my main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
<ListView
                    android:id="@id/list"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:divider="#000000"
                    android:scrollbars="none"
                    android:scrollingCache="true" />
</LinearLayout>

And here is listcatagory.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
       <ListView
        android:id="@+id/list"
        android:layout_width="1px"
        android:layout_height="1px"
        android:layout_weight="1" >
    </ListView>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
        android:weightSum="100" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="38"
            android:orientation="vertical" >

            <WebView
                android:id="@+id/img"
                android:layout_width="70dp"
                android:layout_height="70dp"
                android:paddingBottom="2dp"
                android:paddingLeft="5dp"
                android:paddingRight="5dp"
                android:paddingTop="2dp"
                android:scaleType="centerCrop"/>
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="15"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="#ffffff"
                android:textSize="20dp"
                android:textStyle="bold"
                android:paddingLeft="5dp" />


        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="47"
            android:orientation="vertical" >
        </LinearLayout>
    </LinearLayout>



</LinearLayout>

But when i click the individual listitem nothing is happen..plz anybody tell me why this is happens?

  • 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-02T05:23:22+00:00Added an answer on June 2, 2026 at 5:23 am

    You didn’t actually set the onItemClick listener on your ListView

    try this in your onCreate

    Feed = (ListView) findViewById(R.id.list);
    Feed.setOnItemClickListener(this);
    

    @edit: noticed you don’t actually have your class implement the OnItemClickListener despite creating a method identical to the one you’d implement. Make sure you add implements OnItemClickListener to your class declaration

    public class VediolistfetchActivity extends Activity implements OnItemClickListener
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ProgressDialog onClick not working.. here is my code .. Basically i want to show
I have an activity which I want to show ListView with list of topics,
I want to show the timezone code (such as BST or GMT) based on
I want to show the UIBarButtonItem and UINavigationItem through code in the method viewWillAppear
all I want to show hide some ids using jQuery. My html code is
Why this code don't work,when i want run this code vwd 2008 express show
I want to download a page and show this in WEBVIEW local, but the
I am using my own html code to show a html page in WebView.
Is it possible to somehow retrieve the pin code from WebView in Android while
I want to show a popover view on top of a webview. And the

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.