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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:45:35+00:00 2026-05-23T13:45:35+00:00

I have a problem my ListActivity . I have this xml: <LinearLayout> <ListView android:id=@android:id/list

  • 0

I have a problem my ListActivity.

I have this xml:

<LinearLayout>
    <ListView 
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    />
</LinearLayout>

and inside I have this:

<LinearLayout>
    <ImageView android:id="@+id/flechas"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    />
    <TextView android:id="@+id/textoName"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
    />
    <TextView android:id="@+id/textoPrice"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
    />
    <Button android:id="@+id/boton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="BUY"
        android:layout_marginRight="0dip"
        android:onClick="buy"
    />
</LinearLayout>

I use a BaseAdapter to show it, and this is the main file:

public class Info  extends ListActivity{

static ArrayList<Quotes> objeto= null;
static final ArrayList<HashMap<String, String>> lista= new ArrayList<HashMap<String,String>>();
private ListView mainListView;
private InfoModel [] model;
private CustomAdapterInfo listAdapter;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mainListView= (ListView)findViewById(R.id.);
    setContentView(R.layout.info);


    objeto= new ArrayList<Quotes>();
    Bundle extras=getIntent().getExtras();
    objeto= extras.getParcelableArrayList("datos");

    if ((objeto != null) && (objeto.size() != 0)){
        model= new InfoModel[objeto.size()];
        for (int i=0;i< objeto.size(); i++) {
            model[i]= new InfoModel(0, objeto.get(i).getName(), objeto.get(i).getTrade());
        }
    }

    ArrayList<InfoModel> datos= new ArrayList<InfoModel>();
    datos.addAll(Arrays.asList(model));

    listAdapter= new CustomAdapterInfo(this, datos);
    mainListView.setAdapter(listAdapter);
}

But my mainListView is null. It doesn’t find the R.id.

Any ideas?

  • 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-23T13:45:36+00:00Added an answer on May 23, 2026 at 1:45 pm
    android:id="@android:id/list"
    

    I guess this should be your own ID. Like this:

    android:id="@+id/main_list_view"
    

    After that you can access it using something like:

    mainListView= (ListView)findViewById(R.id.main_list_view);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im opening a ListActivity with an xml called list with a ListView named list.
I have two textviews, a listview (this is a listactivity, by the way) and
I am doing an contact list android application but i have a small problem
I am doing an contact list android application but i have a small problem
I have a problem understanding why is my ListActivity and its corresponding listView empty
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have a problem displaying the results of an sql query into a ListView
I have a problem with my ListActivity, i use a thread to show a
I have created a listActivity with my own ListAdapter. The problem is that the
I'm following the List View tutorial and I have this code (very minor modifications):

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.