Highlighted

Air Android native extensions preserve other activity to be destroyed

Engaged ,
Apr 10, 2019

Copy link to clipboard

Copied

Hello,

I created an Air native extension on Android, I launch my other activity in the ane :

Context context = divExtContext.getActivity().getApplicationContext(); 

Intent myIntent = new Intent(context, OtherActivity.class); 

myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 

context.startActivity(myIntent);

if my app is in background and I click on the app buton or I launch a custom URI, my activity is destroyed.

I tried to add in the app descriptor android:launchMode="singleTop" :

<android>

  <manifestAdditions>

    <![CDATA[

      <manifest>

        <uses-permission android:name="android.permission.PERMISSION_NAME" />

        <application>

          <activity android:launchMode="singleTop">

            <intent-filter>

              <action android:name="android.intent.action.MAIN"/>

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

            </intent-filter>

          </activity>

          <activity android:name="com.nativeExtensions.OtherActivity" android:theme="@android:style/Theme.Dialog"/>

        </application>

      </manifest>

    ]]>

  </manifestAdditions>

</android>

but when my app is in background and I click on the app buton or I launch a custom URI, my activity is not destroyed but I have a black screen.

Is there a workaround ?

Thanks

I find a workaround using singleInstance, it's necessary to reorder the activity.

TOPICS
Performance issues

Views

423

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Air Android native extensions preserve other activity to be destroyed

Engaged ,
Apr 10, 2019

Copy link to clipboard

Copied

Hello,

I created an Air native extension on Android, I launch my other activity in the ane :

Context context = divExtContext.getActivity().getApplicationContext(); 

Intent myIntent = new Intent(context, OtherActivity.class); 

myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 

context.startActivity(myIntent);

if my app is in background and I click on the app buton or I launch a custom URI, my activity is destroyed.

I tried to add in the app descriptor android:launchMode="singleTop" :

<android>

  <manifestAdditions>

    <![CDATA[

      <manifest>

        <uses-permission android:name="android.permission.PERMISSION_NAME" />

        <application>

          <activity android:launchMode="singleTop">

            <intent-filter>

              <action android:name="android.intent.action.MAIN"/>

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

            </intent-filter>

          </activity>

          <activity android:name="com.nativeExtensions.OtherActivity" android:theme="@android:style/Theme.Dialog"/>

        </application>

      </manifest>

    ]]>

  </manifestAdditions>

</android>

but when my app is in background and I click on the app buton or I launch a custom URI, my activity is not destroyed but I have a black screen.

Is there a workaround ?

Thanks

I find a workaround using singleInstance, it's necessary to reorder the activity.

TOPICS
Performance issues

Views

424

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 10, 2019 0
Engaged ,
Apr 13, 2019

Copy link to clipboard

Copied

You can vote for this bug here

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 13, 2019 0
Engaged ,
Apr 14, 2019

Copy link to clipboard

Copied

I find a workaround using singleInstance, it's necessary to reorder the activity.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 14, 2019 0