title: AlertDialog.Builder wont show in current fragment
body: <p>so i have this sidemenu item called appinfo in TemplateHome activity (the default fragment is HomeFragment) that will show the app version inside AlertDialog.Builder</p>
  
  <p>i was able to show the alertdialog just fine, but everytime i click on appinfo menu, the app will always go to HomeFragment/TemplateHome activity</p>
  
  <p>Now does anyone know how to show the alertdialog in the current fragment?</p>
  
  <p>this is my menu code</p>
  
  <pre><code>public void switchhomefragment(MenuItem item) {
          fragment = null;
          Class fragmentClass = HomeFragment.class;
  
          switch (item.getItemId()) {
              case R.id.sidemenu_profil:
                  fragmentClass = ProfileFragment.class;
                  currentfragment = "home";
                  break;
              case R.id.sidemenu_pencarian:
                  fragmentClass = HomeFragment.class;
                  currentfragment = "home";
                  break;
              case R.id.sidemenu_pendaftaran:
                  fragmentClass = PendaftaranFragment.class;
                  currentfragment = "home";
                  break;
              case R.id.sidemenu_fav:
                  break;
              case R.id.sidemenu_tentang:
                  fragmentClass = TentangFragment.class;
                  currentfragment = "home";
                  break;
              case R.id.sidemenu_info:
                  infoaplikasi();
                  break;
              case R.id.action_home:
                  fragmentClass = HomeFragment.class;
                  currentfragment = "home";
                  break;
              case R.id.sidemenu_signout:
                  editor.remove("sessioniduser");
                  editor.commit();
                  methodUmum.tologin(this);
                  break;
              default:
                  fragmentClass = HomeFragment.class;
                  currentfragment = "home";
          }
  
          try {
              fragment = (Fragment) fragmentClass.newInstance();
          } catch (Exception e) {
              Log.d("templatehome", "isi error : " + e);
              e.printStackTrace();
          }
  
          fragmentManager.beginTransaction().addToBackStack(null).replace(R.id.flContent, fragment, currentfragment).commit();
          item.setChecked(true);
          mDrawer.closeDrawers();
      }
  </code></pre>
  
  <p>this is where i call the switchhomefragment code</p>
  
  <pre><code>@SuppressWarnings("StatementWithEmptyBody")
      @Override
      public boolean onNavigationItemSelected(MenuItem item) {
          switchhomefragment(item);
          return true;
      }
  </code></pre>
  
  <p>and this is the AlertDialog.Builder code</p>
  
  <pre><code>public void infoaplikasi() {
          dialog = new AlertDialog.Builder(TemplateHome.this);
          inflater = getLayoutInflater();
          View dialogView = inflater.inflate(R.layout.info_aplikasi, null);
          dialog.setView(dialogView);
          dialog.setCancelable(true);
          dialog.setNegativeButton("TUTUP", new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialogInterface, int i) {
                  dialogInterface.dismiss();
              }
          });
          dialog.show();
      }
  </code></pre>
  
  <p>and this is my info_aplikasi xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:paddingLeft="@dimen/ukr16"
      android:paddingRight="@dimen/ukr16"
      android:paddingTop="@dimen/ukr16"&gt;
  
      &lt;TextView
          android:id="@+id/textView"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:paddingBottom="@dimen/ukr8"
          android:text="App Version"
          android:textAllCaps="true"
          android:textSize="18sp"
          android:textStyle="bold" /&gt;
  
      &lt;TextView
          android:id="@+id/textView2"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:text="version 2.1"
          android:textSize="16sp" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Any advice is helpfull, Thankyou</p>