Modify "android:launchMode="singleTop" in AndroidManifest


#1

When I click on the Launch icon for my app, the app restarts instead of reopening - it looks like this SO thread solves it: https://stackoverflow.com/questions/16126511/app-completely-restarting-when-launched-by-icon-press-in-launcher

Is there any way to adjust this setting with detaching?


Android Standalone: Home screen app icon restarts app from start
#2

yeah. if you detach, you can modify the Android manifest.

If you meant, “without detaching”, I don’t think so, but I don’t think it should restart all the time when you tap on the launcher icon. do you have any other clues as to why it might be happening? someone on that s.o. thread mentioned that restarting their device made the issue go away?


#3

Sorry, yes, mission critical typo :slight_smile:

Is there a way to modify this without detaching? Restarting the device isn’t helping, sadly, no.


#4

Hi, we’d need some more information to figure out what’s going on. What device and OS are you using? And is this a standalone app or in the Expo app?


#5

hi, i’am facing the same issue for my standalone app.

It seems to be device independent. I can reproduce this behavior as described on genymotion and my HTC 10 (Android 7.1).

i don’t know if it helps but my app is called LAPPENBOARD and it’s available on Expo, Google Play Store and Apple App Store.

My Environment:
OS: macOS Sierra 10.12.6
Node: 10.5.0
Yarn: 1.7.0
npm: 6.1.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
expo: ^28.0.0 => 28.0.0
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-28.0.1.tar.gz => 0.55.4

App target: Android Standalone


#6

I’ve been testing a little more, and restarting the app does appear to “fix” the behavior. I coulda sworn I’d still seen it after cycling the power on my device (and hard closing the app), but maybe I’m just getting senile over here. So YES, in my case, restarting the app or device makes the behavior go away.

This is happening on a standalone app, also in the app store: https://play.google.com/store/apps/details?id=com.digitalassetsdata.pms

OS: macOS Sierra 10.12.6
Node: 8.10.0
npm: 6.1.0
expo: 28.0.0
react: 16.4.1
react-native: https://github.com/expo/react-native/archive/sdk-28.0.0.tar.gz
Device: Samsung Galaxy S8
Android Version: 8.0.0
App target: Android Standalone


#7

I have now tested this with the sample “Tab Navigation” template app that Expo generates (completely unmodified) and the problem exists there as well, so it doesn’t appear to be any of our own JS code / settings.

Ticketed here: https://github.com/expo/expo/issues/2000

Would be great to get a fix for this into SDK 29 :crossed_fingers:

Edit: Just to clarify, this is not detached, just a plain standalone build.


#8

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.