How to avoid automatic invoking of paused activity when the transparent activity is triggered and finished its activity

47 Views Asked by At

In my current android app, I am using transparent activity for main and its has some of intent activities. My manifest file as follows,

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:versionName="1.2.0.223" android:versionCode="117">


<application
    android:name=".AppController"
    android:allowBackup="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:requestLegacyExternalStorage="true"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:usesCleartextTraffic="true">


    <activity android:name=".RestartActivity"
        android:process=":Restart"
        android:theme="@android:style/Theme.Translucent.NoTitleBar"
        />
    <activity
        android:name=".BaseActivity"
        android:configChanges="keyboard|orientation"
        android:screenOrientation="locked" />
    <activity
        android:name=".LauncherActivity"
        android:screenOrientation="locked"
        android:configChanges="keyboard|orientation"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name=".SplashScreen"
        android:screenOrientation="locked"
        android:configChanges="keyboard|orientation"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">

    </activity>
    <activity
        android:name=".MainActivity"
        android:permission=""
        android:label="@string/app_name"
        android:theme="@style/Theme.Transparent"
        android:exported="true">

        <!-- This is the main intent filter -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>


        <!-- The below two intent filters handle incoming requests from an android app -->
        <intent-filter>
            <action android:name="android.intent.action.GET_CONTENT" />
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="@string/rootapp" />
            <data
                android:host="localhost"
                android:port="8080" />
            <data android:path="@string/empInfo" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.GET_CONTENT" />
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="@string/rootapp" />
            <data
                android:host="localhost"
                android:port="8080"
                android:path="@string/salaryInfo" />
        </intent-filter>
      

        <activity  android:windowSoftInputMode="adjustResize" android:name=".UpdateEmpInfoActivity" />
       <provider
           android:name="androidx.core.content.FileProvider"
           android:authorities="${applicationId}.provider"
           android:exported="false"
           android:grantUriPermissions="true">
           <meta-data
               android:name="android.support.FILE_PROVIDER_PATHS"
               android:resource="@xml/provider_paths" />
       </provider>
   </application>

</manifest>

main activity is transparent and through the intent I can able to get the employee info from another app.

I have a view in my app, for changing the employee info. If I click the employee info update view to changing the some details. after that I am making the app to background (its went to paused state).

Now, I am triggering the employee info intent to the main activity, after I got the result. I mean after finish activity. The paused view is coming foreground. How to avoid that.

0

There are 0 best solutions below