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

  • SEARCH
  • Home
  • 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 7052829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:25:50+00:00 2026-05-28T03:25:50+00:00

public class List_Items extends ListActivity{ private ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>(); public

  • 0
public class List_Items extends ListActivity{

private ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();

   public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);


       setContentView(R.layout.list_item);

       List <ImageAndText> total_list=new ArrayList<ImageAndText>();

           ListView lv = (ListView) this.findViewById(android.R.id.list);

       lv.setAdapter((ListAdapter) new ImageAndTextListAdapter(this, total_list));

       getListView().setTextFilterEnabled(true);

              //////////////////////////////////////////////////////
      Button btn=(Button) findViewById(R.id.button_sync);
      btn.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
     // TODO Auto-generated method stub
Toast message=Toast.makeText(getApplicationContext(), "click the list_item", Toast.LENGTH_LONG);
            message.show();}
      });
       }

  public void onListItemClick(ListView parent, View v, int position, long id) 
  {         
  Toast.makeText(getApplicationContext(), "You have selected " +(position+1)+"th item",
          Toast.LENGTH_SHORT).show();}

}

I have this list_item which is extends the listactivity. However, when I click on one of the row, the callback onListItemClick didn’t get activated. Why is that? I don’t need to anything with the adapter on this right?

}

  • 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-05-28T03:25:51+00:00Added an answer on May 28, 2026 at 3:25 am

    You have to use the following in all the widgets of xml which you are inflating for your custom ListView.

    android:focusable="false"
    
    android:focusableInTouchMode="false"
    

    Hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

list_item.java public class List_Items extends ListActivity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list_item); ListView
The code below give generate the ListView public class MyList extends ListActivity { static
I create private ArrayList<String> values; . values is assigned a value in the onCreate
I'm creating a class that derives from List... public class MyList : List<MyListItem> {}
package com.example.Calc; import android.R.string; import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter;
I have a specialized list that holds items of type IThing : public class
public class Item { ... } public class Order { public List<Item> Items ...
I have code that looks like this: template<class T> class list { public: class
I have a class like this: public class Contest { List<ContestTeam> Teams { get;
Concerning data binding I have these classes: public class Foo : List<Bar> { public

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.