carsten-klaffke / send-intent

Repository for send-intent Capacitor plugin
MIT License
106 stars 12 forks source link

App crashes when switching between Sliding Tabs by clicking the tabs (not swiping) #91

Open vishu39 opened 6 months ago

vishu39 commented 6 months ago

I am encountering a critical issue with the send intent functionality in my Ionic project. The problem is specific to Android devices. Although the functionality operates seamlessly on iOS, on Android, after sharing data and swiping up to access files or images, the app redirects to the previous URL or reloads the current page Here is my AndroidManifest.xml activity code for intent

<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
        android:name="de.mindlib.sendIntent.SendIntentActivity"
        android:label="@string/app_name"
        android:exported="true"
        android:theme="@style/AppTheme.NoActionBar">
    <intent-filter>
        <action android:name="android.intent.action.SEND" />
          <action android:name="android.intent.action.SEND_MULTIPLE" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
        <data android:mimeType="application/*" />
        <data android:mimeType="video/*" />
        <data android:mimeType="audio/*" />
    </intent-filter>
carsten-klaffke commented 6 months ago

If i understand you correctly, you are talking about open about the app selection menu by swiping up. The SendIntentActivity is a separate activity, so it opens as an extra app instance. If you open the app selection menu, you leave the context of this instance and therefore it closes. This is configured in SendIntentActivity::onStop. If you want to access files or images, you should do that within the instance and not leave the context.