title: How do i move to a new Activity after onChildClick has been clicked in an ExpandableListView without ExpandableListView appending to the new Activity
body: <p><strong>To clarify</strong>, I was able to move from the Fragment <code>class</code> to the new Activity <code>class/view</code>.  However, the problem is the <code>ExpandableListView</code> is appending to the new Activity and I can't figure out how to get rid of that when I move to the new activity. </p>
  
  <p>This is my code:</p>
  
  <p><strong>CategoriesFragment.xml</strong> </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/categoriesID"&gt;
  
  
      &lt;ExpandableListView
          android:id="@+id/expand_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;&lt;/ExpandableListView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>listGroup.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:padding="8dp"
      android:background="@color/colorPrimary"&gt;
  
  
      &lt;TextView
          android:id="@+id/list_group"
          android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
          android:textSize="16dp"
          android:textColor="@android:color/white"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="TextView" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>listItem.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="55dip"&gt;
  
  
      &lt;TextView
          android:id="@+id/list_items"
          android:textSize="16dip"
          android:paddingLeft="?android:attr/expandableListPreferredChildPaddingLeft"
          android:paddingTop="5dp"
          android:paddingBottom="5dp"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="TextView" /&gt;
  &lt;/LinearLayout&gt; 
  </code></pre>
  
  <p><strong>CategoriesFragment class</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Ml7yW.png" rel="nofollow noreferrer">categoriesFragment before a child is clicked</a>  </p>
  
  <p><a href="https://i.stack.imgur.com/8YT25.png" rel="nofollow noreferrer">image of new activity</a></p>
  
  <pre><code>public class CategoriesFragment extends Fragment {
  
      private ExpandableListAdapter listAdapter;
      private ExpandableListView expListView;
      private ArrayList&lt;Group&gt; listDataHeader;
      private ArrayList&lt;Group&gt; originalList;
  
      @Override
      public View onCreateView(@NonNull LayoutInflater inflater,
                               final ViewGroup container, Bundle savedInstanceState) {
          setHasOptionsMenu(true);//in order to create optionalMenu method
  
  
          View rootView = inflater.inflate(R.layout.fragment_categories, container, false);
  
          expListView = (ExpandableListView) rootView.findViewById(R.id.expand_view);
  
          initData();
  
          this.originalList = new ArrayList&lt;Group&gt;();
          this.originalList.addAll(listDataHeader);
  
          listAdapter = new CategoriesViewModel(getActivity(), listDataHeader);
  
          expListView.setAdapter(listAdapter);
  
  
          expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
              @Override
              public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
                  String currentGroupName = listDataHeader.get(groupPosition).getGroupName();
  
                  Intent groupChatIntent = new Intent(getActivity(), GroupChatActivity.class);
                  groupChatIntent.putExtra("groupName", currentGroupName);
  
                  startActivity(groupChatIntent);
  
                  return false;
              }
          });
  
          return rootView;
      }
      }
  
  new Activity that is been called
  
  
  public class GroupChatActivity extends AppCompatActivity {
  
      private Toolbar toolbar;
      private ImageButton sendMsgButton;
      private EditText userText;
      private ScrollView scrollMsgView;
      private TextView displayText;
      private String currentGroupName;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_group_chat);
  
          currentGroupName = getIntent().getExtras().getString("groupName").toString();
  
          initializeField();
  
      }
  
      private void initializeField() {
          toolbar = (Toolbar)findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
          getSupportActionBar().setTitle(currentGroupName);
  
          sendMsgButton = (ImageButton) findViewById(R.id.send_msg_button);
          userText = (EditText) findViewById(R.id.input_group_msg);
          displayText = (TextView) findViewById(R.id.group_chat_text);
          scrollMsgView = (ScrollView) findViewById(R.id.scroll_view);
      }
  }
  </code></pre>