Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Stuck on relaunching first time from icon in Android #53

Open
haris008 opened this issue Feb 12, 2018 · 8 comments
Open

App Stuck on relaunching first time from icon in Android #53

haris008 opened this issue Feb 12, 2018 · 8 comments

Comments

@haris008
Copy link

Step 1 : Install app - Splash shows and close as expected
Step 2 : put app in background by pressing home button
Step : open app from launcher icon, it is stucked at splash screen.

After closing app, it works okay. Only happens on fresh install.

@bhatti-waqas
Copy link

@haris008 : Please use launch mode as "Single Task" in main activity of android manifest. This issue will be gone.

@tamirwd
Copy link

tamirwd commented Feb 27, 2018

@bhatti-waqas I have the same issue, but when clicking on android Back button in step 2 above, tried you solution and unfortunately it didn't work for me. Is there something else I can try to support also this case ?

@bhatti-waqas
Copy link

@tamirwd: Can you please make sure closing splash screen code i.e
SplashScreen.close({ animationType: SplashScreen.animationType.scale, duration: 850, delay: 500, });
is getting executed when you re-run the app ?

@tamirwd
Copy link

tamirwd commented Feb 27, 2018

@bhatti-waqas actually it's not. so I need to detect that the app is re-opened and call this method ? but I thought the splash screen should not even appear in this case no ?

@bhatti-waqas
Copy link

@tamirwd: Yes, you are right. actually I am not very good with android life cycle. I am an ios developer.
So in my case splash screen was re-appearing when opening app again. And I made sure I close it with the code provided. In my landing screen.

@tamirwd
Copy link

tamirwd commented Feb 27, 2018

@bhatti-waqas ok, I used AppState.addEventListener to detect when app is resumed, then I call SplashScreen.close again and it works ! thanks.

@Chetan8488
Copy link

Chetan8488 commented Jun 27, 2018

@Chetan8488 : put below code in onCreate() method of SplashActivity.

if (!isTaskRoot()
&& getIntent().hasCategory(Intent.CATEGORY_LAUNCHER)
&& getIntent().getAction() != null
&& getIntent().getAction().equals(Intent.ACTION_MAIN)) {

        finish();
        return;
    }

@vitto-moz
Copy link

@tamirwd , can you, please, provide more details about your solution? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants