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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:58:54+00:00 2026-06-05T06:58:54+00:00

I have a listview in my application. It works fine but when the number

  • 0

I have a listview in my application. It works fine but when the number of elements
increases then on scrolling down and selecting any view,it shows the force close.
Why so?
The code segment is given as:

 lv1 = (ListView) findViewById(R.id.listView);
     lv1.setAdapter(new ArrayAdapter<String>(this,R.layout.list_item,surveyName));
    // lv1 = getListView();
     lv1.setOnItemClickListener(new OnItemClickListener() {
           public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
             long arg3) {
              ListView lv = (ListView) arg0;
              TextView tv = (TextView) lv.getChildAt(arg2);
              String s = tv.getText().toString();
              for(int i=0;i<ss;i++){
                    if(surveyName[i].equals(s)){
                        id=surveyId[i];
                    }
                }
                Intent j=new Intent(SurveyTool.this,Survey.class);
                Bundle d=new Bundle();
                d.putString("surveyId", id);
                d.putString("userId", userId);
                j.putExtras(d);
                startActivity(j);

           }  });
  • 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-05T06:58:56+00:00Added an answer on June 5, 2026 at 6:58 am
    lv1.setAdapter(new ArrayAdapter<String>(this,R.layout.list_item,surveyName));
    

    replace with this line

    mAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,surveyName);
    

    hop its working well…

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

Sidebar

Related Questions

In a WPF application I have a ListView: <ListView Name=ItemSelList ItemsSource={Binding ItemColl} SelectionChanged=ItemSelList_SelectionChanged> <ListView.View>
In my application, I have list view. Selecting another item in it, triggers an
In my application i have a listView. each item of the list view contains
I have a ListView item in my application. The scroll position does not get
In my application, I have a listview whose list item consists of a TextView
I have an Android application with a ListView in it, the ListView will setup
I am using Eclipse and created HelloWorld and it works fine using emulator. Then
I have an application that works similar to a chat, except beside the location
i have an android application which has a listview for listing 14 items inside
For my application I am using a couple listview. So far have been using

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.