title: how to store notifications from firebase to android app using shared preferences
body: <p>I want to store notifications received from <code>Firebase</code> in my android app. I am using <code>SharedPreferences</code> for that. The problem is when I send notification more then 1 time it overwrites the previous one. </p>
  
  <pre><code>String[] notif={"","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""};
  ListAdapter yo = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,notif);
  ListView yup = findViewById(R.id.list1);
  yup.setAdapter(yo);
  
  SharedPreferences sharedPref = getSharedPreferences("notification", Context.MODE_PRIVATE);
  String y = sharedPref.getString("notify","");
  notif[1]=y;
  </code></pre>