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

  • Home
  • SEARCH
  • 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 7193427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:10:05+00:00 2026-05-28T20:10:05+00:00

i realized that if you try to extend the SimpleAdapter class, you must make

  • 0

i realized that if you try to extend the SimpleAdapter class, you must make the constructor public –

public MySimpleAdapter(Context context, List<? extends Map<String, ?>> data, int resource, String[] from, int[] to) {
    super(context, data, resource, from, to);
}

but this will make it so that someone (or i) could accidentally create a new adapter, right?

i tried to make all of the data and methods static in the adapter, but it just doesn’t seem like the right way to do things…? sorry, i don’t mean to be too picky. i just don’t want someone to accidentally instantiate an instance of MySimpleAdapter

How should i make this class a singleton?

the way i’m using SimpleAdapter is that i use it as a container to hold all the objects that i need in a dynamically shrinking/growing listview. At any point in the app, there should only be one such container. am i approaching this problem 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-28T20:10:06+00:00Added an answer on May 28, 2026 at 8:10 pm

    You really don’t want to make the adapter a static singleton. The reason for this is that it has a reference to the context. By making the adapter static, the context will never be garbage collected.

    If anything, you want to keep a static instance of your List. On each activity, simply pass in a reference to the shared list and off you go.

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

Sidebar

Related Questions

EDIT: Thx to suggestions from the mailing list I realized that the problem I
I'm writing a custom view that directly extends android.view.View . If I try to
I have realized that I have to make Image from EBS Volume everytime when
I try to realize a link (in fact many links) that update a table
I realized that I can have problems with single quotes in php arrays: <?php
I just realized that in some place in my code I have the return
Some days ago I realized that PrintWriter (as well as PrintStream ) never throw
Today I realized that I no longer have a Web Content Form option (where
I just realized that I need to synchronize a significant amount of data collection
I just realized that the method Element.getElementsByTagName(someTagName) returns a nodelist of all elements in

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.