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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:18:13+00:00 2026-05-26T22:18:13+00:00

I have a list view and when item in the listview clicked, I save

  • 0

I have a list view and when item in the listview clicked, I save the detail to sqlite db using AyscTask which is called from listview’s onitemclicklistener. When user randomly clicks many items application crashes as app try to access db in peculier way. This happens when the user is fast enough to click multiple items in the listview before the loading alert shows up.

How can I prevent this?? I tried to disable listview inside the listview’s onitemclick method but it didn’t work too.

my code

//setting up the listview
        ListView lv = (ListView) findViewById(android.R.id.list);
        setListAdapter(new TypeArrayAdapter(TypeSelectActivity.this, R.layout.row_type, typeList));

        lv.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                    long arg3) {

                sectionid = Integer.parseInt(LocationWebService.incidentTypeSectionId
                        .get(arg2));
                incidentid1 = Integer
                .parseInt(LocationWebService.incidentTypeId
                        .get(arg2));

                LocationWebService.IncidentTypeID = incidentid1;
                LocationWebService.sectionID = sectionid;
                new DBTasks().execute(arg2);
                TextView tv=(TextView)arg1.findViewById(R.id.label_type);
                TypeString=tv.getText().toString();
                Log.v("TypeSelect", TypeString);

            }
        });

Thanks for your time in advance.

  • 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-26T22:18:13+00:00Added an answer on May 26, 2026 at 10:18 pm

    try using disable the list in AsnykTask -> PreExecute and enabling the list in PostExecute..

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

Sidebar

Related Questions

I have a list view control which at the moment only allows one item
I have created a custom listview using adapter. Each row of the list view
I currently have a list view which has several rows of data and I
I have a list of items displayed as a ListBox. <ListView ItemsSource={Binding ListOfSomeItems}> <ListView.View>
I have a onListItemClick that returns the text from item in the listview with:
I currently have a listview which contains a couple of strings. These are called
I have a ListActivity class, and when any item on the list is clicked,
I want to have a list of elements (using a ListView) and each element
Basically, I have a custom ListView in which each item looks like: <LinearLayout> <Table>
I have two activities. In activity1 , I have list view which is populated

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.