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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:26:09+00:00 2026-06-07T01:26:09+00:00

I have created ListView fetching data from app db, and it’s working fine, when

  • 0

I have created ListView fetching data from app db, and it’s working fine, when I want to display just one information, like team name, in one entry.

Now I’m trying to display more information, like team name, date, and town (all data from db, delivered by Cursor). And I can’t make it work, Intent is displaying ListView but there is no text in any of the entries… I don’t know how to explain it more clearly.

Intent code:

 public class Games extends Activity implements OnClickListener {

Button bNewGame;
ListView gameList;
GameDayTableAdapter db;
Cursor c;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.games);
    bNewGame = (Button) findViewById(R.id.bNewGame);
    bNewGame.setOnClickListener(this);
    gameList = (ListView) findViewById(R.id.lvGameList);
    db = new GameDayTableAdapter(this);
    db.open();
    c = db.getAll();
    startManagingCursor(c);
    setListView();
}

private void setListView() {
    // TODO Auto-generated method stub
    SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this,
            android.R.layout.simple_expandable_list_item_1, c,
            new String[] { AbstractDbAdapter.TEAM_NAME, AbstractDbAdapter.GAME_DAY_HOME_GAME, AbstractDbAdapter.GAME_DAY_DATE },
            new int[] { R.id.game_entry_team, R.id.game_entry_home, R.id.game_entry_date });
    gameList.setClickable(true);
    gameList.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> arg0, View v, int position, long id) {

        }
    });

    gameList.setAdapter(mAdapter);
    gameList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

}

public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
    case R.id.bNewGame:
        Intent intent = new Intent(Games.this, NewGame.class);
        startActivity(intent);
        db.close();
        finish();
        break;
    }
}

game_list_entry.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
    android:id="@+id/game_entry_team"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <TextView
        android:id="@+id/game_entry_home"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        />

    <Space
        android:layout_width="50dp"
        android:layout_height="match_parent" />

    <TextView
        android:id="@+id/game_entry_date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"/>
</LinearLayout>

That’s what I managed to do based on some tutorial available on-line, but not, it’s not working, and I don’t know how to fix it. I found other tutorials where people create new class which extends SimpleCursorAdapter, but that looks like a lot of extra work, and I’m wondering if there is an easier way to do it.

  • 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-07T01:26:10+00:00Added an answer on June 7, 2026 at 1:26 am

    You are setting your list to use the expandablelist row view that comes with the framework. You need to specify your custom one instead.

    Replace this:

    android.R.layout.simple_expandable_list_item_1
    

    With this:

    R.layout.game_list_entry
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have created one listview.now i want to show data(contact no.,name) from contactlist of
I have created a custom ArrayAdapter to display data within ListView items from an
HI Guyz i have created a sectioned custom listview using baseadapter its working fine
I am trying to display ListView . I have created one activity , in
I'm working on an app that currently just uses a listview for a menu,
Actually I have created a custom ListView . I want to add items to
I have a ListView than contains a list of image created from web link
I have created an ArrayList<HashMap<String, String>> collection to hold my data for ListView .
I have Created a ListView and set a background image.Everything goes fine except I
I have created a dynamic listview which contains a CheckBox.what I want is at

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.