File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
kotlin/com/simplemobiletools/filemanager/activities Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 3131 <category android : name =" android.intent.category.OPENABLE" />
3232 <category android : name =" android.intent.category.DEFAULT" />
3333 </intent-filter >
34+
35+ <intent-filter >
36+ <action android : name =" android.intent.action.VIEW" />
37+ <category android : name =" android.intent.category.DEFAULT" />
38+ <data android : mimeType =" resource/folder" />
39+ </intent-filter >
3440 </activity >
3541
3642 <activity
Original file line number Diff line number Diff line change @@ -79,16 +79,20 @@ class MainActivity : SimpleActivity() {
7979 private fun tryInitFileManager () {
8080 handlePermission(PERMISSION_WRITE_STORAGE ) {
8181 if (it) {
82- initRootFileManager ()
82+ initFileManager ()
8383 } else {
8484 toast(R .string.no_storage_permissions)
8585 finish()
8686 }
8787 }
8888 }
8989
90- private fun initRootFileManager () {
91- openPath(config.homeFolder)
90+ private fun initFileManager () {
91+ if (intent.action == Intent .ACTION_VIEW && intent.data != null && intent.data.scheme == " file" ) {
92+ openPath(intent.data.path)
93+ } else {
94+ openPath(config.homeFolder)
95+ }
9296 }
9397
9498 private fun openPath (path : String ) {
You can’t perform that action at this time.
0 commit comments