title: Double ListView In FrameLayout Android
body: <p>I have one Drawerlayout when i start app, data into MainActivity with pagemain_layout(frame_container)... Everything is fine. But when i click item in drawerlayout appear double listview in pagemain_layout.</p>
  
  <p>Pls... Give me a solution or edit my code.</p>
  
  <p>Thank you very much !</p>
  
  <p>Code MainActivity</p>
  
  <pre><code>public class MainActivity extends Activity {
  
      private DrawerLayout mDrawerLayout;
      private ListView mListDrawer;
      private ActionBarDrawerToggle mDrawerToggle;
      private CharSequence mDrawerTitle;
      private CharSequence mTitle;
      private String[] navMenuTitles;
      NavDrawerItemsAdapter adapterTest;
      FragmentManager fragmentManager;
      ListView lvItemLayoutMain;
      ProgressDialog pDialog;
      ArrayList&lt;String&gt; mListTitle;
      ArrayList&lt;String&gt; mListURL;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.pagemain_layout);
          mTitle = mDrawerTitle = getTitle();
          List&lt;Integer&gt; mListHeader = new ArrayList&lt;Integer&gt;();
          mListHeader.add(0);
          mListHeader.add(5);
          adapterTest = new NavDrawerItemsAdapter(MainActivity.this,
                  NavigationListItem.getListItemAdapter(this, mListHeader));
          mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
          mListDrawer = (ListView) findViewById(R.id.list_slidermenu);
          navMenuTitles = getResources().getStringArray(R.array.title);
          lvItemLayoutMain = (ListView) findViewById(R.id.list_item_main);
          mListDrawer.setOnItemClickListener(new SlideMenuClickListener());
          mListDrawer.setAdapter(adapterTest);
          getActionBar().setDisplayHomeAsUpEnabled(true);
          getActionBar().setHomeButtonEnabled(true);
          new LoadData().execute();
          mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
                  R.drawable.ic_drawer, R.string.app_name, R.string.app_name) {
  
              @Override
              public void onDrawerOpened(View view) {
                  getActionBar().setTitle(mDrawerTitle);
                  invalidateOptionsMenu();
              }
  
              @Override
              public void onDrawerClosed(View view) {
                  getActionBar().setTitle(mTitle);
                  invalidateOptionsMenu();
              }
  
          };
          mDrawerLayout.setDrawerListener(mDrawerToggle);
          if (savedInstanceState == null) {
              displayView(0);
          }
  
      }
  
      private void displayView(int position) {
          // update the main content by replacing fragments
          Fragment fragment = null;
          FragmentTransaction transaction = fragmentManager.beginTransaction();
          switch (position) {
          case 1:
              fragment = new HotNewsFragment();
              break;
          case 2:
              fragment = new FocusNewsFragment();
              break;
          case 3:
              fragment = new EducationInfoFragment();
              break;
          case 4:
              fragment = new WorkingStudentsFragment();
              break;
          case 6:
              fragment = new TimeTableFragment();
              break;
          case 7:
              fragment = new NoteFragment();
              break;
  
          default:
              break;
          }
  
          if (fragment != null) {
              fragmentManager = getFragmentManager();
              transaction.replace(R.id.frame_container, fragment).commit();
              transaction.addToBackStack(null);
              transaction.commit();
              // update selected item and title, then close the drawer
              mListDrawer.setItemChecked(position, true);
              mListDrawer.setSelection(position);
              setTitle(navMenuTitles[position]);
              mDrawerLayout.closeDrawer(mListDrawer);
          } else {
              Log.e("MainActivity", "Error in creating fragment");
          }
      }
  
      private class SlideMenuClickListener implements
              ListView.OnItemClickListener {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position,
                  long id) {
              // display view for selected nav drawer item
              displayView(position);
          }
      }
  
      @Override
      public void setTitle(CharSequence title) {
          mTitle = title;
          getActionBar().setTitle(title);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // toggle nav drawer on selecting action bar app icon/title
          if (mDrawerToggle.onOptionsItemSelected(item)) {
              return true;
          }
          // Handle action bar actions click
          switch (item.getItemId()) {
          case R.id.action_settings:
              return true;
          default:
              return super.onOptionsItemSelected(item);
          }
      }
  
      @Override
      protected void onPostCreate(Bundle savedInstanceState) {
          super.onPostCreate(savedInstanceState);
          // Sync the toggle state after onRestoreInstanceState has occurred.
          mDrawerToggle.syncState();
      }
  
      @Override
      public void onConfigurationChanged(Configuration newConfig) {
          super.onConfigurationChanged(newConfig);
          // Pass any configuration change to the drawer toggls
          mDrawerToggle.onConfigurationChanged(newConfig);
      }
  
      class LoadData extends AsyncTask&lt;Void, Void, Vector&lt;ArrayList&lt;String&gt;&gt;&gt; {
          String Url = "http://ued.vn/rss/cong-tac-sinh-vien.rss";
          Vector&lt;ArrayList&lt;String&gt;&gt; data = new Vector&lt;ArrayList&lt;String&gt;&gt;();
          final String KEYGROUP = "Thông báo";
  
          @Override
          protected void onPreExecute() {
              pDialog = ProgressDialog.show(MainActivity.this, "", "Loading...");
              mListTitle = new ArrayList&lt;String&gt;();
              mListURL = new ArrayList&lt;String&gt;();
              super.onPreExecute();
          }
  
          @Override
          protected Vector&lt;ArrayList&lt;String&gt;&gt; doInBackground(Void... params) {
              data = Utils.getDataNews(Url, KEYGROUP);
              return data;
          }
  
          @Override
          protected void onPostExecute(Vector&lt;ArrayList&lt;String&gt;&gt; result) {
              if (data != null) {
                  pDialog.dismiss();
                  mListTitle = data.get(0);
                  NewsHotAdapter adapter = new NewsHotAdapter(MainActivity.this,
                          R.layout.item_layout, mListTitle);
                  lvItemLayoutMain.setAdapter(adapter);
              }
              super.onPostExecute(result);
          }
  
      }
  
  }
  </code></pre>
  
  <p>And Code In pagemain_layout.xml</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;FrameLayout
          android:id="@+id/frame_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  
          &lt;ListView
              android:id="@+id/list_item_main"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="start"
              android:choiceMode="singleChoice"
              android:dividerHeight="1dp" /&gt;
      &lt;/FrameLayout&gt;
  
      &lt;ListView
          android:id="@+id/list_slidermenu"
          android:layout_width="240dp"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:background="@color/list_background"
          android:choiceMode="singleChoice"
          android:divider="@color/list_divider"
          android:dividerHeight="1dp"
          android:listSelector="@drawable/list_selector" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Problem Here !</p>
  
  <p><img src="https://i.stack.imgur.com/LozVM.png" alt="problem here"></p>