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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:11:51+00:00 2026-05-28T05:11:51+00:00

I created an adapter public class MyArrayAdapter extends ArrayAdapter<Watch> overriding public MyArrayAdapter(Context context, List<Watch>

  • 0

I created an adapter

public class MyArrayAdapter extends ArrayAdapter<Watch> 

overriding

public MyArrayAdapter(Context context, List<Watch> values){     
    super(context, android.R.layout.simple_list_item_1, values);        
    this.context = context;
}

and

private View createOneView(){
...
}

Then i do

 MyArrayAdapter myAdapter = new MyArrayAdapter(this, getAllWatches());
 ... //DO some stuff here
 myAdapter.remove(getAllWatches().get(2));
 myAdapter.notifyDataSetChanged();

The watch is still not removed. I suspect that objects are removed only if ther are == and not .equal(), or am I just missing something more trivial?

  • 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-28T05:11:52+00:00Added an answer on May 28, 2026 at 5:11 am

    myAdapter.getPosition(getAllWatches().get(2)) return -1, so the problem is the object is not found. ArrayAdapater uses indeed .equals() method. Implementing it in the appropriate way (comparingfields) everything works smoothly.

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

Sidebar

Related Questions

I created custom adapter like this public class SettingsAdapter extends BaseAdapter{ ArrayList<String> Noptions =
Here is my code for a simple cursor adapter. public class CursorList extends ListActivity
public class testMultiAutoCompleteTextView extends ListActivity { /** Called when the activity is first created.
public class TestConnection extends Activity { /** Called when the activity is first created.
I have created a custom Base Adapter class, to populate a list view with
public class VideoDemo extends Activity { private VideoView video; private MediaController ctlr; File clip=new
I have the following class in my program: public class RZoom extends Activity {
Why is my OnItemClickListener not working? public class UseAdp extends Activity { /** Called
Activity 2 public class Menus extends Activity { //set constants for MediaStore to query,
I have created a new class called Get_WebPage1 and init I have extends that

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.