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

Page not rendering to full screen upon navigating to it's associated route on Android when invoked via the Android onResume() lifecycle method (can happen while tapping on a notification) #16636

Closed
MaikuB opened this issue Apr 16, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@MaikuB
Copy link

commented Apr 16, 2018

Steps to Reproduce

Suspect this is a bug unless i'm missing something. I'm writing a plugin for displaying notifications and the repository with the code that can reproduce this (in the example folder) can be found at https://github.com/MaikuB/flutter_local_notifications/tree/master

The scenario I have is when a notification is displayed (Flutter app will use a platform channel to display a notification) then tapping on it would trigger navigating to another route. This involves handling the intent associated with the notification and use the platform channel invoke Dart code on the Flutter side. When the navigation code is hooked up to fire when a button is pressed, it behaves as expected. However wiring that up as I've done for when the notification is tapped results in the second not taking up the full screen with the first screen being partially visible as per the screenshot below

screen shot 2018-04-17 at 6 41 54 am

This happens when the application is already running but not when the application has been launched via a notification. Logs show that the Android onResume() lifecycle method is invoked (to be expected). So I tried override the activity's onResume method so that it invokes a method via the platform channel that would handled in Flutter/Dart code to trigger navigation Sounds like a possible race condition somewhere in the engine as creating a Timer object that triggers navigation in the callback works fine after a bit of delay. It even works fine when the notification is displayed instantly but the Timer has a duration of zero (i.e. it should trigger the callback instantly).

Logs

logs from flutter run

Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                       0.9s
Resolving dependencies...                                    1.2s
Running 'gradlew assembleDebug'...                          10.3s
Built build/app/outputs/apk/debug/app-debug.apk (30.7MB).
Installing build/app/outputs/apk/app.apk...                  3.3s
I/FlutterActivityDelegate(22686): onResume setting current activity to this
Syncing files to device Android SDK built for x86...
D/        (22686): HostConnection::get() New Host Connection established 0x99ae47c0, tid 22722
D/EGL_emulation(22686): eglMakeCurrent: 0xa31b29a0: ver 3 0 (tinfo 0x976ff3b0)
D/EGL_emulation(22686): eglMakeCurrent: 0x99b052a0: ver 3 0 (tinfo 0x99b03380)

🔥  To hot reload your app on the fly, press "r". To restart the app entirely, press "R".
An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:8100/
For a more detailed help message, press "h". To quit, press "q".
I/FlutterActivityDelegate(22686): onResume setting current activity to this
I/flutter (22686): notification payload: hi

No issues found from flutter analyze command. Note that both commands were run on the example app

Flutter Doctor

[✓] Flutter (Channel beta, v0.2.8, on Mac OS X 10.13.3 17D102, locale en-AU)
    • Flutter version 0.2.8 at /Users/michaelbui/flutter
    • Framework revision b397406561 (2 weeks ago), 2018-04-02 13:53:20 -0700
    • Engine revision c903c217a1
    • Dart version 2.0.0-dev.43.0.flutter-52afcba357

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/michaelbui/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /Users/michaelbui/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3, Build version 9E145
    • ios-deploy 1.9.2
    • CocoaPods version 1.4.0

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Community Edition (version 2017.3.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 23.0.2
    • Dart plugin version 173.4700

[✓] VS Code (version 1.22.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Dart Code extension version 2.11.2

[!] Connected devices
    ! No devices available

@MaikuB MaikuB changed the title Page not rendering to full screen upon navigating to it's associated route on Android Page not rendering to full screen upon navigating to it's associated route on Android when invoked via the Android onResume() lifecycle method Apr 17, 2018

@MaikuB MaikuB changed the title Page not rendering to full screen upon navigating to it's associated route on Android when invoked via the Android onResume() lifecycle method Page not rendering to full screen upon navigating to it's associated route on Android when invoked via the Android onResume() lifecycle method (can happen while tapping on a notification) Apr 19, 2018

@MaikuB

This comment has been minimized.

Copy link
Author

commented Apr 22, 2018

Closing as this was fixed on the flutter master channel

@MaikuB MaikuB closed this Apr 22, 2018

@praveendp526

This comment has been minimized.

Copy link

commented Jul 2, 2018

same issue i am facing using flutter version2.3, how to fix this??

@zoechi

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2018

@praveendp526 there is no Flutter version 2.3.
Please add the output of flutter doctor.

@GyuriMajercsik

This comment has been minimized.

Copy link

commented Dec 14, 2018

I believe this happens to me as well. My app exits full screen mode after taking a screenshot. I cannot make it fullscreen only after I exit and restart the application.

@zoechi

This comment has been minimized.

Copy link
Contributor

commented Dec 14, 2018

@GyuriMajercsik this issue is long closed.
Please create a new issue with all information you can provide that allows us to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.