mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-17 03:16:27 -04:00
#2280 added intent to KiwixMainActivity for local file transfer
This commit is contained in:
parent
ed6480a25d
commit
4c8fe0f192
@ -39,6 +39,17 @@
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data android:mimeType="application/octet-stream" />
|
||||
<data android:pathPattern=".*\\.zim" />
|
||||
<data android:pathPattern=".*\\..*\\.zim" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\.zim" />
|
||||
<data android:pathPattern=".*\\..*\\..*\\..*\\.zim" />
|
||||
<data android:host="*" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
|
@ -308,6 +308,7 @@ open class WifiDirectManager @Inject constructor(
|
||||
disconnect()
|
||||
}
|
||||
unregisterWifiDirectBroadcastReceiver()
|
||||
callbacks = null
|
||||
}
|
||||
|
||||
private fun disconnect() {
|
||||
|
@ -120,6 +120,12 @@ class KiwixMainActivity : CoreMainActivity() {
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
when (intent.action) {
|
||||
Intent.ACTION_SEND_MULTIPLE -> {
|
||||
setIntent(intent)
|
||||
navigate(R.id.localFileTransferFragment)
|
||||
}
|
||||
}
|
||||
supportFragmentManager.fragments.filterIsInstance<FragmentActivityExtensions>().forEach {
|
||||
it.onNewIntent(intent, this)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user