Back to project page filemanager.
The source code is released under:
MIT License
If you think the Android project filemanager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.binkery.app.filemanager; //from w w w . j a va 2 s . co m import android.app.Activity; import android.app.Fragment; import android.app.FragmentManager; import com.binkery.app.filemanager.fragments.BaseDialogFragment; import com.binkery.app.filemanager.fragments.DeleteDialogFragment; import com.binkery.app.filemanager.fragments.DetailDialogFragment; import com.binkery.app.filemanager.fragments.FileListFragment; import com.binkery.app.filemanager.fragments.RenameDialogFragment; public class FragmentController { private static FragmentManager mfm = null; private static FragmentManager getFragmentManager(Activity act) { if (mfm != null) { return mfm; } mfm = act.getFragmentManager(); return mfm; } public static void showEnterFragment(Activity act) { FragmentManager fm = getFragmentManager(act); Fragment fragment = FileListFragment.newInstance("/"); fm.beginTransaction().add(R.id.container, fragment) .commit(); } public static void showSdcardFragment(Activity act){ FragmentManager fm = getFragmentManager(act); Fragment fragment = FileListFragment.newInstance("/mnt/sdcard/"); fm.beginTransaction().add(R.id.container, fragment).commit(); } public static void showFileDetailFragment(Activity act, String[] paths) { FragmentManager fm = getFragmentManager(act); // BaseDialogFragment fragment = DetailDialogFragment.newInstance(paths); // fragment.show(fm, "dialog"); // fm.beginTransaction().add(R.id.container, fragment).commit(); BaseDialogFragment.show(DetailDialogFragment.class, paths, fm); } public static void showFilesDeleteFragment(Activity act, String[] paths) { FragmentManager fm = getFragmentManager(act); BaseDialogFragment.show(DeleteDialogFragment.class, paths, fm); } public static void showFileRenameFragment(Activity act,String[] paths){ FragmentManager fm = getFragmentManager(act); BaseDialogFragment.show(RenameDialogFragment.class, paths, fm); } }