一个目录选择Android库:Android-DirectoryChooser
jopen
10年前
一个简单的目录选择,可以集成你的Android应用程序。
public class DirChooserFragmentSample extends Activity implements DirectoryChooserFragment.OnFragmentInteractionListener { private TextView mDirectoryTextView; private DirectoryChooserFragment mDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dialog); mDialog = DirectoryChooserFragment.newInstance("DialogSample", null); mDirectoryTextView = (TextView) findViewById(R.id.textDirectory); findViewById(R.id.btnChoose) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mDialog.show(getFragmentManager(), null); } }); } @Override public void onSelectDirectory(@Nonnull String path) { mDirectoryTextView.setText(path); mDialog.dismiss(); } @Override public void onCancelChooser() { mDialog.dismiss(); } }
项目主页:http://www.open-open.com/lib/view/home/1409302164994