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

No ticking after resuming from non-FlutterActivity #15777

Closed
chsigg opened this issue Mar 21, 2018 · 8 comments
Closed

No ticking after resuming from non-FlutterActivity #15777

chsigg opened this issue Mar 21, 2018 · 8 comments
Assignees

Comments

@chsigg
Copy link

chsigg commented Mar 21, 2018

Steps to Reproduce

When passing a result from Android back to Flutter through MethodChannel.Result directly from a FlutterActivity::onActivityResult without waiting for the call to FlutterActivity::onResume(), some things go wrong. For example, showing a snack bar or starting an animation doesn't work.

I've attached a repro. The app is supposed to increment both counters at the same rate, but the second one only increments at half the rate.

Logs

flutter run output:
Launching lib\main.dart on Pixel 2 XL in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk (25.4MB).
Installing build\app\outputs\apk\app.apk...
I/FlutterActivityDelegate( 8137): onResume setting current activity to this
Syncing files to device Pixel 2 XL...
D/AppActivity( 8137): onCreate()
D/MainActivity( 8137): onActivityResult()
I/FlutterActivityDelegate( 8137): onResume setting current activity to this
I/flutter ( 8137): Started animation after 'startActivity'
I/flutter ( 8137): Started animation after 'none'

I tapped the FAB twice and the screen now says (2 forward / 1 completed).

flutter analyze output:
No issues found!
Ran in 7.0s

Flutter Doctor

flutter doctor -v:
[√] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version 10.0.16299.309], locale en-US)
• Flutter version 0.1.5 at C:\Users\Christian\Documents\Visual Studio 2017\ThirdParty\flutter
• Framework revision 3ea4d06 (4 weeks ago), 2018-02-22 11:12:39 -0800
• Engine revision ead227f
• Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\Christian\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Android Studio (version 3.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Connected devices (1 available)
• Pixel 2 XL • 710KPYR0349426 • android-arm64 • Android 8.1.0 (API 27)

• No issues found!

animation.zip

@chsigg
Copy link
Author

chsigg commented Mar 21, 2018

The attached activity waits for onPostResume() to return the result, which makes the counters increment synchronously.
MainActivity.java.txt

@jonahwilliams
Copy link
Member

This is possibly related to #11906

@najeira
Copy link
Contributor

najeira commented Mar 22, 2018

similar: #13818 #14619 #14665

@jonahwilliams jonahwilliams self-assigned this Mar 24, 2018
@jonahwilliams
Copy link
Member

This should also be fixed by a combination of flutter/engine#4848 and #16261

@MaikuB
Copy link
Contributor

MaikuB commented Apr 22, 2018

@jonahwilliams @najeira I'm guessing the issue I've raised #16636 is a dupe of this?

@jonahwilliams
Copy link
Member

@MaikuB that does sound similar to the issue that I fixed - the changes have been rolled into master so you should be able to confirm. Otherwise I can look at your issue as a follow up.

@MaikuB
Copy link
Contributor

MaikuB commented Apr 22, 2018

@jonahwilliams brilliant, confirmed it's fixed on master so i'll close the issue i've raised. thanks

@github-actions
Copy link

github-actions bot commented Sep 3, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants