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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:29:14+00:00 2026-05-31T11:29:14+00:00

I have a custom CursorAdapter and it looks like : public class LabelAdapter extends

  • 0

I have a custom CursorAdapter and it looks like :

public class LabelAdapter extends CursorAdapter {

Context con;
LayoutInflater mFactory;

public AlarmTimeAdapter(Context context, Cursor c) {
    super(context, c);
    con = context;
    mFactory = LayoutInflater.from(con);
}

@Override
public void bindView(View view, final Context context, Cursor cursor) {


    final String label2 = cursor.getString(AlarmData.ALARM_TITLE_INDEX);

    ..code to fill in the textview with whats in the cursor


}

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) { 
    View ret = mFactory.inflate(R.layout.item_lv, parent, false);

    return ret;
}

}

my item_lv looks like:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/relativeLayout1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="10dp"
    android:focusable="true"
    >

         <TextView
        android:id="@+id/label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="14dp"
        android:textAppearance="?android:attr/textAppearanceSmall" />


</RelativeLayout>

When I call :

ListView lv = (ListView)findViewById(R.id.listview); //Listview is in the main.xml file
lv.setAdapter(new LabelAdapter(this, mCursor);
lv.setFocusable(true);

The items in the listview aren’t selectable.. does anyone know whats wrong? I’ve set the items focusable, but they aren’t able to be clicked. Help! Thanks!

  • 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-31T11:29:15+00:00Added an answer on May 31, 2026 at 11:29 am

    Set onItemClickListener to your listView-

    lv.setOnItemClickListener(new OnItemClickListener(){
    
    @Override
        public void onItemClick(AdapterView<?> adapter, View view, int position,
                long arg3) {
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have custom ImageView: public class ShadowedImageView extends ImageView { private Paint mPaint; public
i have created a My custom listActivty by extending ListActivity like this. public class
I have custom exceptions in my django project that look like this: class CustomFooError(Exception):
I have a custom cursor adapter and I'd like to put an image into
hi i would like to create a custom calendar, this calendar will have custom
I have a custom CursorAdapter that is taking items from a database and displaying
I have a ListView with a custom CursorAdapter feed from a MatrixCursor . Each
I have a ListView with a custom CursorAdapter. Between the parameter of CursorAdapter I
i have a listview with checkbox in each rows. i'm using custom cursoradapter and
I have a Listview with custom cursor adapter. I'm trying to prevent input in

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.