Skip to content Skip to sidebar Skip to footer

Onresume() Not Called By Pressing Back Button In Activitygroup

As ActivityGroup manages the Activities in the form of view, so when I try to return back to the Parent Activity that called the child Activity in ActivityGroup the onResume() is n

Solution 1:

Try this, when you press back button using ActivityGroup.

publicvoidback()
    {
     if ( arrList.size() > 1 )
      {
       arrList.remove(arrList.size() - 1);
       View v = arrList.get(arrList.size() - 1);

       Activity_name object = ((Activity_name)v.getContext());
       object.onResume();
       setContentView(v);
      }
     else {
      this.finish();
     }
    }

Solution 2:

onResume is a lifecycle method called by OS when activity comes to the top of the stack. You can't call it directly.

Post a Comment for "Onresume() Not Called By Pressing Back Button In Activitygroup"