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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:36:37+00:00 2026-05-27T16:36:37+00:00

Im using a SimpleCursorAdapter to fill the list inside an AlertDialog. The SimpleCursorAdapter uses

  • 0

Im using a SimpleCursorAdapter to fill the list inside an AlertDialog. The SimpleCursorAdapter uses the android.R.layout.simple_list_item_1 layout.

The dialog pops up. The list has correct amount of entries. But nothing is displayed. If I choose one entry, the selected entry ist highlighted and the text from my cursor is displayed.

The selection chooses the right entry.

Here is my code:

Intent dataIntent = new Intent();
dataIntent.setData(Ereignistypen.CONTENT_URI);
Cursor cursor = managedQuery(dataIntent.getData(), new String[] {
        Ereignistypen._ID, // 0
        Ereignistypen.NAME // 1
    }, null, null, Ereignistypen.ORDERBY);

SimpleCursorAdapter typAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, cursor,
        new String[] { Ereignistypen.NAME }, new int[] { android.R.id.text1 });

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.ereignistyp);
builder.setAdapter(typAdapter, this);
AlertDialog typPicker = builder.create();
typPicker.show();

What do I wrong?

I checked Android SimpleCursorAdapter results not displaying in AlertDialog. But it was little helpfull to me.

EDIT:
If I switch to android.R.layout.simple_spinner_item the list is displayed in an ugly style. But the entries are visible.

  • 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-27T16:36:37+00:00Added an answer on May 27, 2026 at 4:36 pm

    The text is there but is not visible because of style.

    I made my own layout with slightly different styles.
    This is the original simple_list_item_1 out of sdk sources.

    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
       android:id="@android:id/text1"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:textAppearance="?android:attr/textAppearanceLarge"
       android:gravity="center_vertical"
       android:paddingLeft="6dip"
       android:minHeight="?android:attr/listPreferredItemHeight"
    />
    

    I extended to following:

    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
       android:id="@android:id/text1"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:textAppearance="?android:attr/textAppearanceLarge"
       android:textColor="?android:attr/textColorPrimaryInverseDisableOnly"
       android:gravity="center_vertical"
       android:paddingLeft="6dip"
       android:minHeight="?android:attr/listPreferredItemHeight"
    />
    

    Setting the textcolor explicit solved the problem.
    I’m not shure which layout is used if I set the items with AlertDialog.builder.setItem

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

Sidebar

Related Questions

I read a tutorial, and it uses SQLlite and SimpleCursorAdapter to fill the list
I have a ListView with SimpleCursorAdapter. The layout was using a LinearLayout, but when
I'm using a GridView to show a list of TV channels using a SimpleCursorAdapter
I am new to android and working with listviews . I am using SimpleCursorAdapter
I've got a class that creates a list from a DB using SimpleCursorAdapter. I
I've populated a ListActivity from a Cursor using SimpleCursorAdapter that starts another activity when
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using C#, I need a class called User that has a username, password, active
I'm trying to fill a grid view using data from a db cursor using
How do I get a ListView using a SimpleCursorAdapter to show in a ViewPager?

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.