简体   繁体   English

为什么会出现带有SharedPreference变量的ArrayIndexOutOfBoundsException?

[英]Why am I getting an ArrayIndexOutOfBoundsException with SharedPreference variable?

I have a simple application that prints jokes and saves your "favorite" ones. 我有一个简单的应用程序,可以打印笑话并保存您的“收藏夹”。 I am running into an arrayoutofbounds issue and I am not sure what I am doing wrong. 我遇到了arrayoutofbounds问题,我不确定自己在做什么错。 Here is my code: 这是我的代码:

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.InterstitialAd;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * Created by Android on 11/15/15.
 */
public class Pun extends Activity {

    private InterstitialAd interstitial;

    public static final String PREFS_NAME = "MyPrefsFile";

    public static final String TAG = Pun.class.getSimpleName();
    public static final String mPath = "body.txt";
    public static final String mBusinessPath = "business.txt";
    public static final String mCrimePath = "crime.txt";
    public static final String mEducationPath = "education.txt";
    public static final String mEntertaintmentPath = "entertainment.txt";
    public static final String mFoodPath = "food.txt";
    public static final String mHealthPath = "health.txt";
    public static final String mNaturePath = "nature.txt";
    public static final String mPeoplePath = "people.txt";
    public static final String mPlacesPath = "places.txt";
    public static final String mTechnologyPath = "technology.txt";
    public static final String mTransportationPath = "transportation.txt";
    public static final String mWorkPath = "work.txt";
    private QuoteBank mQuoteBank;
    private List<String> mLines;
    private int counter = 0;

    private static int SIZE = 20;
    private String favorites1[] = new String[SIZE];
    private String favorites2[] = new String[SIZE];
    private String favorites3[] = new String[SIZE];
    private String favorites4[] = new String[SIZE];
    private String favorites5[] = new String[SIZE];
    private String favorites6[] = new String[SIZE];
    private String favorites7[] = new String[SIZE];
    private String favorites8[] = new String[SIZE];
    private String favorites9[] = new String[SIZE];
    private String favorites10[] = new String[SIZE];
    private String favorites11[] = new String[SIZE];
    private String favorites12[] = new String[SIZE];
    private String favorites13[] = new String[SIZE];

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pun);

        // Create the interstitial.
        interstitial = new InterstitialAd(this);
        interstitial.setAdUnitId("ca-app-pub-9704824959875003/5950200773");

        mQuoteBank = new QuoteBank(this);

        final TextView textView = (TextView) findViewById(R.id.textView);

        Random r = new Random();
        final int i1 = r.nextInt(20 - 1) + 1;

        mQuoteBank = new QuoteBank(this);
        mLines = mQuoteBank.readLine(mPath);

        textView.setText(mLines.get(i1));

        favorites1 = new String[SIZE];
        favorites2 = new String[SIZE];
        favorites3 = new String[SIZE];
        favorites4 = new String[SIZE];
        favorites5 = new String[SIZE];
        favorites6 = new String[SIZE];
        favorites7 = new String[SIZE];
        favorites8 = new String[SIZE];
        favorites9 = new String[SIZE];
        favorites10 = new String[SIZE];
        favorites11 = new String[SIZE];
        favorites12 = new String[SIZE];
        favorites13 = new String[SIZE];

        // Set all favorites1 to false for initial setup
        for (int i = 0; i < SIZE; i++) {
            favorites1[i] = "false";
            favorites2[i] = "false";
            favorites3[i] = "false";
            favorites4[i] = "false";
            favorites5[i] = "false";
            favorites6[i] = "false";
            favorites7[i] = "false";
            favorites8[i] = "false";
            favorites9[i] = "false";
            favorites10[i] = "false";
            favorites11[i] = "false";
            favorites12[i] = "false";
            favorites13[i] = "false";

        }

        Context mContext = getApplicationContext();

        // Save and Load array
        //saveArray(favorites1,"favorites1",this);
        favorites1 = loadArray("favorites1",this);
        favorites2 = loadArray("favorites2",this);
        favorites3 = loadArray("favorites3",this);
        favorites4 = loadArray("favorites4",this);
        favorites5 = loadArray("favorites5",this);
        favorites6 = loadArray("favorites6",this);
        favorites7 = loadArray("favorites7",this);
        favorites8 = loadArray("favorites8",this);
        favorites9 = loadArray("favorites9",this);
        favorites10 = loadArray("favorites10",this);
        favorites11 = loadArray("favorites11",this);
        favorites12 = loadArray("favorites12",this);
        favorites13 = loadArray("favorites13",this);

        final ImageButton favoritesBtn = (ImageButton) findViewById(R.id.imageButton);
        favoritesBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                switch (MainActivity.category){
                    case "body":
                        if(favorites1[i1-1].equals("true")){
                            favorites1[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites1[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "crime":
                        if(favorites2[i1-1].equals("true")){
                            favorites2[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites2[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "entertainment":
                        if(favorites3[i1-1].equals("true")){
                            favorites3[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites3[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "health":
                        if(favorites4[i1-1].equals("true")){
                            favorites4[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites4[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "people":
                        if(favorites5[i1-1].equals("true")){
                            favorites5[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites5[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "technology":
                        if(favorites6[i1-1].equals("true")){
                            favorites6[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites6[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "work":
                        if(favorites7[i1-1].equals("true")){
                            favorites7[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites7[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "business":
                        if(favorites8[i1-1].equals("true")){
                            favorites8[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites8[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "education":
                        if(favorites9[i1-1].equals("true")){
                            favorites9[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites9[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "food":
                        if(favorites10[i1-1].equals("true")){
                            favorites10[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites10[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "nature":
                        if(favorites11[i1-1].equals("true")){
                            favorites11[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites11[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "places":
                        if(favorites12[i1-1].equals("true")){
                            favorites12[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites12[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "transportation":
                        if(favorites13[i1-1].equals("true")){
                            favorites13[i1-1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites13[i1-1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    default:
                        break;
                }


                saveArray(favorites1,"favorites1",Pun.this);
                saveArray(favorites2,"favorites1",Pun.this);
                saveArray(favorites3,"favorites1",Pun.this);
                saveArray(favorites4,"favorites1",Pun.this);
                saveArray(favorites5,"favorites1",Pun.this);
                saveArray(favorites6,"favorites1",Pun.this);
                saveArray(favorites7,"favorites1",Pun.this);
                saveArray(favorites8,"favorites1",Pun.this);
                saveArray(favorites9,"favorites1",Pun.this);
                saveArray(favorites10,"favorites1",Pun.this);
                saveArray(favorites11,"favorites1",Pun.this);
                saveArray(favorites12,"favorites1",Pun.this);
                saveArray(favorites13,"favorites1",Pun.this);

            }
        });

        switch (MainActivity.category) {
            case "body":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mPath);

                System.out.print(i1);

                if(favorites1[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "crime":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mCrimePath);
                if(favorites2[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "entertainment":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mEntertaintmentPath);
                if(favorites3[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "health":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mHealthPath);
                if(favorites4[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "people":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mPeoplePath);
                if(favorites5[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "technology":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mTechnologyPath);
                if(favorites6[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "work":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mWorkPath);
                if(favorites7[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "business":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mBusinessPath);
                if(favorites8[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "education":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mEducationPath);
                if(favorites9[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "food":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mFoodPath);
                if(favorites10[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "nature":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mNaturePath);
                if(favorites11[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "places":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mPlacesPath);
                if(favorites12[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            case "transportation":
                mQuoteBank = new QuoteBank(this);
                mLines = mQuoteBank.readLine(mTransportationPath);
                if(favorites13[i1-1].equals("true"))
                    favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                break;
            default:
                break;
        }


        final Button btn1 = (Button) findViewById(R.id.next);
        btn1.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Random r = new Random();
                int i1 = r.nextInt(20 - 1) + 1;

                textView.setText(mLines.get(i1));

                counter++;
                if (counter == 3) {
                    counter = 0;
                    // ad
                    displayInterstitial();
                }

                switch (MainActivity.category) {
                    case "body":
                    if (favorites1[i1 - 1].equals("true")) {
                        favorites1[i1 - 1] = "false";
                        favoritesBtn.setBackgroundResource(R.drawable.starblank);
                    } else {
                        favorites1[i1 - 1] = "true";
                        favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                    }
                    break;
                    case "crime":
                        if (favorites2[i1 - 1].equals("true")) {
                            favorites2[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites2[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "entertainment":
                        if (favorites3[i1 - 1].equals("true")) {
                            favorites3[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites3[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "health":
                        if (favorites4[i1 - 1].equals("true")) {
                            favorites4[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites4[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "people":
                        if (favorites5[i1 - 1].equals("true")) {
                            favorites5[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites5[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "technology":
                        if (favorites6[i1 - 1].equals("true")) {
                            favorites6[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites6[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "work":
                        if (favorites7[i1 - 1].equals("true")) {
                            favorites7[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites7[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "business":
                        if (favorites8[i1 - 1].equals("true")) {
                            favorites8[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites8[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "education":
                        if (favorites9[i1 - 1].equals("true")) {
                            favorites9[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites9[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "food":
                        if (favorites10[i1 - 1].equals("true")) {
                            favorites10[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites10[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "nature":
                        if (favorites11[i1 - 1].equals("true")) {
                            favorites11[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites11[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "places":
                        if (favorites12[i1 - 1].equals("true")) {
                            favorites12[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites12[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    case "transportation":
                        if (favorites13[i1 - 1].equals("true")) {
                            favorites13[i1 - 1] = "false";
                            favoritesBtn.setBackgroundResource(R.drawable.starblank);
                        } else {
                            favorites13[i1 - 1] = "true";
                            favoritesBtn.setBackgroundResource(R.drawable.staryellow);
                        }
                        break;
                    default:
                        break;
                }

                saveArray(favorites1,"favorites1",Pun.this);
                saveArray(favorites2,"favorites1",Pun.this);
                saveArray(favorites3,"favorites1",Pun.this);
                saveArray(favorites4,"favorites1",Pun.this);
                saveArray(favorites5,"favorites1",Pun.this);
                saveArray(favorites6,"favorites1",Pun.this);
                saveArray(favorites7,"favorites1",Pun.this);
                saveArray(favorites8,"favorites1",Pun.this);
                saveArray(favorites9,"favorites1",Pun.this);
                saveArray(favorites10,"favorites1",Pun.this);
                saveArray(favorites11,"favorites1",Pun.this);
                saveArray(favorites12,"favorites1",Pun.this);
                saveArray(favorites13,"favorites1",Pun.this);
            }
        });


    }

    public void displayInterstitial() {

        // Create ad request.
        AdRequest adRequest = new AdRequest.Builder().build();

        // Begin loading your interstitial.
        interstitial.loadAd(adRequest);

        if (interstitial.isLoaded()) {
            interstitial.show();
        }
    }

    public boolean saveArray(String[] array, String arrayName, Context mContext) {
        SharedPreferences prefs = mContext.getSharedPreferences("preferencename", 0);
        SharedPreferences.Editor editor = prefs.edit();
        editor.putInt(arrayName +"_size", array.length);
        for(int i=0;i<array.length;i++)
            editor.putString(arrayName + "_" + i, array[i]);
        return editor.commit();
    }

    public String[] loadArray(String arrayName, Context mContext) {
        SharedPreferences prefs = mContext.getSharedPreferences("preferencename", 0);
        int size = prefs.getInt(arrayName + "_size", 0);
        String array[] = new String[size];
        for(int i=0;i<size;i++)
            array[i] = prefs.getString(arrayName + "_" + i, null);
        return array;
    }
}

It seems to be occuring at this part: 这似乎发生在这一部分:

if(favorites1[i1-1].equals("true"))

Here are the load and save methods: 以下是加载和保存方法:

public boolean saveArray(String[] array, String arrayName, Context mContext) {
        SharedPreferences prefs = mContext.getSharedPreferences("preferencename", 0);
        SharedPreferences.Editor editor = prefs.edit();
        editor.putInt(arrayName +"_size", array.length);
        for(int i=0;i<array.length;i++)
            editor.putString(arrayName + "_" + i, array[i]);
        return editor.commit();
    }

    public String[] loadArray(String arrayName, Context mContext) {
        SharedPreferences prefs = mContext.getSharedPreferences("preferencename", 0);
        int size = prefs.getInt(arrayName + "_size", 0);
        String array[] = new String[size];
        for(int i=0;i<size;i++)
            array[i] = prefs.getString(arrayName + "_" + i, null);
        return array;
    }

NOTE ^ the above methods work fine. 注意^上述方法可以正常工作。 My application ran correctly with one favorites array, but when I added more it started crashing. 我的应用程序使用一个收藏夹数组正确运行,但是当我添加更多数组时,它开始崩溃。 I must be missing something simple, but I can't find it. 我一定缺少简单的东西,但找不到。 Thanks. 谢谢。

Your array initializations are always being overwritten by the returns from loadArray() . 您的数组初始化总是被loadArray()的返回值覆盖。 But if there wasn't an array saved with the name passed to loadArray() , it returns an empty array. 但是,如果没有保存名称传递给loadArray()的数组,它将返回一个空数组。 Then when you try to access an element of that array it will give an out-of-bounds exception. 然后,当您尝试访问该数组的元素时,它将给出界外异常。 Try running your load operations first, and then do your "false" initialization only if there was not data loaded. 尝试先运行装入操作,然后仅在没有装入数据的情况下进行“假”初始化。

Stop using a String[] and start using ArrayList instead, this way you can add elements until your heart is content, and you won't have to manage which String[] you are using. 停止使用String []并开始使用ArrayList,这样您就可以添加元素,直到您心满意足为止,而不必管理要使用的String []。

Here is a code snippet that should get you started: 这是一个应该帮助您入门的代码段:

List<String> favorites = new ArrayList<String>();

Then to add an element: 然后添加一个元素:

favorites.add(myFavorite);

To get an element: 获取元素:

favorites.get(elementId);

Or you can use a Map key-value pair: 或者,您可以使用地图键/值对:

Map<String,String> favorites = new HashMap<String, String>();

where the first String is the key you want to save, and the second String is the Value, and in your case the value would be the category you are sorting the favorites on. 其中第一个String是您要保存的键,第二个String是Value,在您的情况下,值将是您要对收藏夹进行排序的类别。 To add a value: 要添加值:

favorites.put("http://thiscool.link", "sports");

To iterate over the Map: 要遍历地图:

String desiredKey = "sports";
for(String key : favorites.keyMap()){
     if(desiredKey.equals(favorites.get(key)){
         return key;
     }
}

Since all keys to the Map are unique. 由于地图的所有键都是唯一的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么尽管使用大小初始化数组,但为什么仍然出现ArrayIndexOutOfBoundsException - Why am I getting ArrayIndexOutOfBoundsException in spite of initializing the array with a size 当我尝试在listView android中删除一行时,为什么会出现ArrayIndexOutOfBoundsException? - Why am i getting ArrayIndexOutOfBoundsException when i try to delete a row in listView android? 如何在活动开始时引用我从 SharedPreference 获得的值 - How to Referesh value I am getting from SharedPreference on start of Activity 我不断收到ArrayIndexOutOfBoundsException - I keep getting ArrayIndexOutOfBoundsException 为什么收到警告“变量可能未初始化” - Why am I getting warning “variable may not be initialized” 为什么我会收到有关变量初始化的错误? - Why am I getting this error about variable initialization? 我无法使用Mockito测试SharedPreference - I am unable to test SharedPreference using Mockito 带有boolean-array的SharedPreference上的ArrayIndexOutOfBoundsException吗? - ArrayIndexOutOfBoundsException on SharedPreference with boolean-array? Android SharedPreference:我无法保存信息 - Android SharedPreference : I am unable to save information 为什么检索时sharedpreference值没有进入? - Why sharedpreference value not getting in when retrieving?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM