mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
fix #84, handle view folder intent
This commit is contained in:
parent
f00aee04b6
commit
0187fb3c03
@ -31,6 +31,12 @@
|
|||||||
<category android:name="android.intent.category.OPENABLE"/>
|
<category android:name="android.intent.category.OPENABLE"/>
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
<data android:mimeType="resource/folder"/>
|
||||||
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
|
@ -79,7 +79,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
private fun tryInitFileManager() {
|
private fun tryInitFileManager() {
|
||||||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||||
if (it) {
|
if (it) {
|
||||||
initRootFileManager()
|
initFileManager()
|
||||||
} else {
|
} else {
|
||||||
toast(R.string.no_storage_permissions)
|
toast(R.string.no_storage_permissions)
|
||||||
finish()
|
finish()
|
||||||
@ -87,8 +87,12 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initRootFileManager() {
|
private fun initFileManager() {
|
||||||
openPath(config.homeFolder)
|
if (intent.action == Intent.ACTION_VIEW && intent.data != null && intent.data.scheme == "file") {
|
||||||
|
openPath(intent.data.path)
|
||||||
|
} else {
|
||||||
|
openPath(config.homeFolder)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun openPath(path: String) {
|
private fun openPath(path: String) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user