Note that there are some explanatory texts on larger screens.

plurals
  1. POSaving Bundle object into shared preference
    primarykey
    data
    text
    <p>I have 2 Activities</p> <p>Activity1</p> <p>Activity2</p> <p><strong>Activity1:</strong></p> <pre><code>Intent intent= new Intent(Activity1.this,Acivity2.class); Bundle b=new Bundle(); b.putParcelableArrayList("actionArray", (ArrayList&lt;? extends Parcelable&gt;) AllListArray.get(0)); b.putParcelableArrayList("comedyArray", (ArrayList&lt;? extends Parcelable&gt;) AllListArray.get(1)); b.putParcelableArrayList("loveArray", (ArrayList&lt;? extends Parcelable&gt;) AllListArray.get(2)); b.putParcelableArrayList("classicsArray", (ArrayList&lt;? extends Parcelable&gt;) AllListArray.get(3)); b.putParcelableArrayList("familyArray", (ArrayList&lt;? extends Parcelable&gt;) AllListArray.get(4)); intent.putExtras(b); startActivity(intent); </code></pre> <p><strong>Activity2:</strong></p> <p>Activity2:</p> <pre><code> public List&lt;Movie&gt; actionArray; public List&lt;Movie&gt; comedyArray; public List&lt;Movie&gt; loveArray; public List&lt;Movie&gt; classicsArray; public List&lt;Movie&gt; familyArray; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle recdData = getIntent().getExtras(); if(recdData!=null) { actionArray=recdData.getParcelableArrayList("actionArray"); comedyArray=recdData.getParcelableArrayList("comedyArray"); loveArray=recdData.getParcelableArrayList("loveArray"); classicsArray=recdData.getParcelableArrayList("classicsArray"); familyArray=recdData.getParcelableArrayList("familyArray"); } } </code></pre> <p>My Requirement is to Store the <code>Bundle(recdData)</code> into <code>Sharedpreferences</code> in Activity2? Could any one help me?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload