Android: Proper home detection during initial startup
This commit is contained in:
parent
1de9930cf4
commit
ce447e220c
|
@ -172,13 +172,12 @@ public class FileBrowser extends Fragment {
|
|||
* findViewById(R.id.about).setOnTouchListener(viblist);
|
||||
*/
|
||||
|
||||
File home = new File(mPrefs.getString(Config.pref_home, home_directory));
|
||||
if (!home.exists() || !home.isDirectory()) {
|
||||
String temp = mPrefs.getString(Config.pref_home, null);
|
||||
if (temp == null || !new File(temp).isDirectory()) {
|
||||
showToastMessage(getActivity().getString(R.string.config_home), Snackbar.LENGTH_LONG);
|
||||
} else {
|
||||
installButtons();
|
||||
}
|
||||
|
||||
if (!ImgBrowse && !games) {
|
||||
new LocateGames(R.array.flash).execute(home_directory);
|
||||
} else {
|
||||
|
|
|
@ -259,9 +259,9 @@ public class MainActivity extends AppCompatActivity implements
|
|||
builder.setPositiveButton(R.string.browse,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
onMainBrowseSelected(false,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath(),
|
||||
false, null);
|
||||
String home_directory = mPrefs.getString(Config.pref_home,
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
onMainBrowseSelected(false, home_directory, false, null);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.gdrive,
|
||||
|
|
Loading…
Reference in New Issue