Sfoglia il codice sorgente

fix to close media view when press back button

when starting media tab from conversation info, the back button opened media tab again. to fix this FLAG_ACTIVITY_CLEAR_TOP was set as flag

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 3 anni fa
parent
commit
b22ed7399d

+ 4 - 5
app/src/main/AndroidManifest.xml

@@ -96,11 +96,6 @@
             android:name="android.max_aspect"
             android:value="10" />
 
-        <activity
-            android:name=".activities.SharedItemsActivity"
-            android:exported="false"
-            android:theme="@style/AppTheme"/>
-
         <activity
             android:name=".activities.MainActivity"
             android:label="@string/nc_app_name"
@@ -172,6 +167,10 @@
             android:theme="@style/TakePhotoTheme"
             android:windowSoftInputMode="stateHidden" />
 
+        <activity
+            android:name=".activities.SharedItemsActivity"
+            android:theme="@style/AppTheme"/>
+
         <receiver android:name=".receivers.PackageReplacedReceiver">
             <intent-filter>
                 <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />

+ 2 - 0
app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt

@@ -187,6 +187,8 @@ class ConversationInfoController(args: Bundle) :
 
     private fun showSharedItems() {
         val intent = Intent(activity, SharedItemsActivity::class.java)
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
         intent.putExtra(BundleKeys.KEY_CONVERSATION_NAME, conversation?.displayName)
         intent.putExtra(BundleKeys.KEY_ROOM_TOKEN, conversationToken)
         intent.putExtra(BundleKeys.KEY_USER_ENTITY, conversationUser as Parcelable)