Skip to content
Snippets Groups Projects
Commit 2b816200 authored by Augusto Bott's avatar Augusto Bott
Browse files

Added intentExtra on FileChooser so we can choose different 'root' (initial)...

Added intentExtra on FileChooser so we can choose different 'root' (initial) directories to pick a particular filename (instead of hard-coded '/sdcard/')
parent 6f46f30d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -45,6 +45,8 @@ public class Preferences extends PreferenceActivity
mAuthorizedKeys.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
Intent p = new Intent(getBaseContext(), com.h3r3t1c.filechooser.FileChooser.class);
p.putExtra("path", "/sdcard/");
// p.putExtra("path", "/mnt");
startActivityForResult(p, R.string.activity_file_chooser);
return true;
}
Loading
Loading
Loading
Loading
@@ -30,7 +30,17 @@ public class FileChooser extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
currentDir = new File("/sdcard/");
Bundle extras = getIntent().getExtras();
String tmp;
if(extras !=null)
{
tmp = extras.getString("path");
}
else
{
tmp = "/sdcard/";
}
currentDir = new File(tmp);
fill(currentDir);
}
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment