requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);\r
setSupportProgressBarIndeterminateVisibility(false);\r
\r
-// Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(getApplicationContext()));\r
+ //Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(getApplicationContext()));\r
\r
if(savedInstanceState != null) {\r
mDirs = savedInstanceState.getStringArray(KEY_DIR_ARRAY);\r
\r
initDelayedTilAccountAvailabe();\r
\r
- // PIN CODE request\r
- // best location is to decide; let's try this first\r
- boolean pinStart = false;\r
- SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\r
- pinStart = appPrefs.getBoolean("set_passcode", false);\r
- \r
- if (pinStart) {\r
- Intent i = new Intent(getApplicationContext(), PinCodeActivity.class);\r
- i.putExtra("activity", "splash");\r
- startActivity(i);\r
+ // PIN CODE request ; best location is to decide, let's try this first\r
+ //if (savedInstanceState == null) {\r
+ if (getIntent().getAction() != null && getIntent().getAction().equals(Intent.ACTION_MAIN) && savedInstanceState == null) {\r
+ requestPinCode();\r
}\r
\r
+ \r
} else {\r
\r
setContentView(R.layout.no_account_available);\r
if (account_name.equals(AccountUtils.getCurrentOwnCloudAccount(context).name)) { \r
\r
String synchFolderRemotePath = intent.getStringExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH); \r
- \r
- if (mCurrentDir == null)\r
+ \r
+ boolean fillBlankRoot = false;\r
+ if (mCurrentDir == null) {\r
mCurrentDir = mStorageManager.getFileByPath("/");\r
+ fillBlankRoot = (mCurrentDir != null);\r
+ }\r
\r
- if (synchFolderRemotePath != null && mCurrentDir != null && mCurrentDir.getRemotePath().equals(synchFolderRemotePath) ) {\r
+ if (synchFolderRemotePath != null && mCurrentDir != null && (mCurrentDir.getRemotePath().equals(synchFolderRemotePath) || fillBlankRoot) ) {\r
FileListFragment fileListFragment = (FileListFragment) getSupportFragmentManager()\r
.findFragmentById(R.id.fileList);\r
mCurrentDir = getStorageManager().getFileByPath(synchFolderRemotePath);\r
}\r
\r
}\r
+ \r
+\r
+ /**\r
+ * Launch an intent to request the PIN code to the user before letting him use the app\r
+ */\r
+ private void requestPinCode() {\r
+ boolean pinStart = false;\r
+ SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\r
+ pinStart = appPrefs.getBoolean("set_pincode", false);\r
+ if (pinStart) {\r
+ Intent i = new Intent(getApplicationContext(), PinCodeActivity.class);\r
+ i.putExtra(PinCodeActivity.EXTRA_ACTIVITY, "FileDisplayActivity");\r
+ startActivity(i);\r
+ }\r
+ }\r
\r
\r
}\r