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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:35:09+00:00 2026-05-26T09:35:09+00:00

I currently have an application that is storing around 10 variables per android view

  • 0

I currently have an application that is storing around 10 variables per android view in which all of the views need to have their variables changed dynamically. How would be the best way of storing these variables in an efficient way and or would be less code because as of right now I have around 200 variables and each one being called like 4 times to change the variables.

So like this:

String buttonName = "blah";

buttonName = newValue;

Would using an ArrayList save more code and help OOD? Also most of the views have ints, floats, & String variables assigned to them. I need a good way to save code that could possibly work for multiple Views that all need different values. Any Ideas? Any help would be greatly appreciated! Thanks!

  • 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-26T09:35:10+00:00Added an answer on May 26, 2026 at 9:35 am

    I would extend whatever Views you are using and store the additional variables in your extended class…

     //constructor
     public class MyButton extends Button{
       public String someVariable;
       public Button(Context c){
           super(c);
       }
    
     }
    

    then in your code you would use it like…

    MyButton b = new MyButton(this);
    b.someVariable = "foofy"; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have an application that gets hit with over 20,000 users daily and
We currently have an application that depends largely on stored procedures. There is a
Currently I have an application that receives an uploaded file from my web application.
I currently have a c++ application that gets built on xp and windows vista/7
I currently have an MS Access application that connects to a PostgreSQL database via
I currently have a UINavigationController based application that works just fine. I'd like to
We currently have a quite complex business application that contains a huge lot of
I am working on splitting out an existing, working application that I currently have
I have an application that is currently running against a 32-bit SQL Server 2005
I have an application that I'm converting to Symfony/Doctrine. It currently stores a serialized

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.