Notificación de AndroidDataSetChanged () no funciona

I am working on ArrayAdapter and ListView. I have an Activity A y actividad B. Activity A starts an Activity B (startActivityForResult()) and when Activity B is finished, it returns the result back to Activity A.

Actividad A:

protected void onCreate(Bundle savedInstanceState) {
    listViewPrayerList = (ListView) findViewById(;
    prayerList = new ArrayList<PrayerSetting>();
    if (getIntent().hasExtra(Utils.PRAYER_LIST)) {
        prayerList.addAll((ArrayList<PrayerSetting>) getIntent()
        pAdapter = new PrayerAdapter(this, R.layout.prayer_list_item,
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (data != null && data.hasExtra(Utils.SETTINGS)) {
        PrayerSetting p = (PrayerSetting) data
        prayerList.set(itemClickedPosition, p);
        pAdapter.notifyDataSetChanged(); // UI/List doesn't change

I don't understand what I am doing wrong! I have tried many solutions but still don't get it.

  1. Stackoverflow Question 1
  2. Stackoverflow Question 2
  3. Stackoverflow Question 3
  4. Blogspot link
  5. Stackoverflow Question 4

I do understand that its a basic question. Thanks in Advance.

preguntado el 28 de mayo de 14 a las 13:05

how are you setting the adapter? please post -

listView.setAdapter(pAdapter); -

can you please post complete code i.e. adapter initializing and your custom adapter -

Is it data really changed? -

Try re-setting the adapter. I've had this issue before and this worked. -

1 Respuestas

Intenta moverte

pAdapter = new PrayerAdapter(this, R.layout.prayer_list_item,

before if statement in onCreate

contestado el 28 de mayo de 14 a las 13:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.