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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:34:23+00:00 2026-05-26T04:34:23+00:00

//Activity– mTweetApp.SetCaseInfo(type,teet); //storing in another class public void SetCaseInfo(String PatientType,ArrayList arr){ // All objects

  • 0
//Activity-- mTweetApp.SetCaseInfo(type,teet); //storing in another class

public void SetCaseInfo(String PatientType,ArrayList arr){
   // All objects are from 
   SharedPreferences settings =setSharedPreferences(DEALSPOTR_PREFS,0);
   SharedPreferences.Editor editor = settings.edit();
   editor.putInt("arrayLength",arr.size());
   for(int i=0; i<=arr.size(); i++){
      editor.putInt("Teethsselected"+String.valueOf(i), (Integer) arr.get(i));
   }
   editor.putString("view", PatientType);
   for(int i=0; i<=arr.size(); i++){
       System.out.println("Teethsselected-----"+(Integer) arr.get(i)+"type--->"+PatientType);
   }
}

public void getCaseInfo() {
   SharedPreferences settings =getSharedPreferences(DEALSPOTR_PREFS, 0);
   int arraySize = settings.getInt("arrayLength", 0); 
   int teeth[] =new int[arraySize];
   for(int i=0; i<arraySize; i++){
      teeth[i] = ettings.getInt("Teethsselected"+String.valueOf(i),0);
   } 
   String type =settings.getString("view"," ");
}

how to fix this?

  • 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-26T04:34:24+00:00Added an answer on May 26, 2026 at 4:34 am

    First, when you write your pref values, no call of commit().
    Second, the pref file is not written to /data/data/com.package.App/shared_prefs/pref_file.xml, hence when reading the SharedPreferences object is NULL.

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

Sidebar

Related Questions

In Activity we have method @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); //... } My
Main Activity public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menumenu, menu); return true; } public void
Activity 2 public class Menus extends Activity { //set constants for MediaStore to query,
my Activity class calls to another non-activity class and when i try to use
My activity class look like this: AssetManager assetmgr= getAssets(); String list[] = assetmgr.list(subdir); if
My activity is a ListActivity populated by an ArrayList<HashMap<String,String>> THREADS; I've also defined an
Class Activity{ private int level; private Activity predecessor; } My program creates instances of
I have a Activity class and a Renderer class (extends GLSurfaceView implements Renderer). Inside
An activity opens the SurfaceView class passing the context. I want to close de
Activity that is sending the putExtra() @Override protected void onListItemClick(ListView l, View v, int

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.