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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:10:06+00:00 2026-06-12T14:10:06+00:00

I am posting some code to understand which array can be used globally in

  • 0

I am posting some code to understand which array can be used globally in any activity and the array may be needed in any activity.

     Intent intent          =   getIntent();
     JSONArray beaconsArray     =   null;
     String jsonArray       =   intent.getStringExtra("activeBeaconsArray");
     try 
        {
            beaconsArray = new JSONArray(jsonArray);
            System.out.println(beaconsArray.toString(2));
        } 
     catch (JSONException e) { e.printStackTrace();}

Should i store beaconsArray in any static array variable in a separate class so that I can use it any activity wherever needed OR should I make parent class that will be super class of all those classes which need this array (beaconsArray ) ?
I do not want to fetch it again and again from database!

  • 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-06-12T14:10:07+00:00Added an answer on June 12, 2026 at 2:10 pm

    Create a class which extends Application class and add your data to it. Any data you add to it will be persistent till the app ends.

    A good example can be found here,

    Using the Android Application class to persist data

    http://www.helloandroid.com/tutorials/maintaining-global-application-state

    or you can go for Sharedperefernce. But you have to understand that data added to them are persistent unless you overwrite it.

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

Sidebar

Related Questions

Unions can be used as a type just like a class and structure(with some
I'm porting some code from other language to Ruby, in my Class I need
I'm porting some code from Python 2 to 3. This is valid code in
I'm looking at porting some code that uses java.util.concurrent.ConcurrentSkipListSet to an environment where this
I'm porting some WPF code to WinRT. The code uses System.Windows.Media.Animation.ParallelTimeline to syncrhonize two
I'm porting some (working) code from Linux to Windows 8. I'm using DDK. typedef
I'm porting over some code from one project to another within my company and
I'm porting some C++ code to C#. Does C# have an equivalent to std::nth_element()
I am porting some C# code over to Java. I am having trouble with
I am porting some Core Data code from iPhone to Mac OS X. Problem

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.