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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:04:28+00:00 2026-05-22T22:04:28+00:00

I have listview with some listadapter after click on item from list I’d like

  • 0

I have listview with some listadapter after click on item from list I’d like to reload list with new data, change adapter’s contests.

I use this in setOnItemClickListener, but I get error: “Type The constructor ArrayAdapter(new AdapterView.OnItemClickListener(){}, int, ArrayList) is undefined”

list.setAdapter(new ArrayAdapter<String>(this, R.layout.simple_list_item_1,Data.user.getChosen_rest()));

How should I do this correctly?

  • 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-22T22:04:29+00:00Added an answer on May 22, 2026 at 10:04 pm

    Glendon’s answer is probably the right one. Nevertheless, in case you really need to change the adapter for some reason, you need to pass the right Context instance to the first argument of the constructor.

    You can extend OnClickListener and add a field mContext to it, to which you will assign the current Activity. Then , use it as:

    list.setAdapter(new ArrayAdapter<String>(mContext, R.layout.simple_list_item_1,Data.user.getChosen_rest()));
    

    Alternatively, if the listener is an inner class of the Activity, you can use:

    list.setAdapter(new ArrayAdapter<String>(MyActivity.this, R.layout.simple_list_item_1,Data.user.getChosen_rest()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView that contains some data from sqllite table. the table is
In my primary Activity, I am using ListView to list some data, and have
I have a listView with some data coming from a server.I want to do
In my app I have a ListView when user click on an item some
I have a ListView with multiple choice entries where some are checked from the
I have a listview and each item has a title, some info, and a
I have a listview that's populated by rows that get their data from a
I have seen some ListView dynamic growing implementations which use OnScrollListener. I would like
I have a listview with some items. I would like to get the text
I have a ListView in a ListActivity that's bound to some data. I have

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.