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

sample with AppCompatActivity #89

Closed
Lakedaemon opened this issue May 15, 2015 · 2 comments
Closed

sample with AppCompatActivity #89

Lakedaemon opened this issue May 15, 2015 · 2 comments

Comments

@Lakedaemon
Copy link

As the method onRetainNonConfigurationInstance() is final in AppCompatActivity,

  1. Does flow work with AppCompat ?
  2. if yes, how should one modify the MainActivity class (in the sample) to work with AppCompatActivity ?
@almozavr
Copy link

NonConfigurationInstance nonConfig;
        if (activity instanceof FragmentActivity) {
            nonConfig = (NonConfigurationInstance) ((FragmentActivity) activity).getLastCustomNonConfigurationInstance();
        } else {
            nonConfig = (NonConfigurationInstance) activity.getLastNonConfigurationInstance();
        }

and

@Override public Object onRetainCustomNonConfigurationInstance() {
        return presenta.provideNonConfigurationInstance();
    }

@Lakedaemon
Copy link
Author

Thanks for the tip. I got it to work with
@OverRide public Object onRetainCustomNonConfigurationInstance() {
return flowSupport.onRetainNonConfigurationInstance()
}

and your change in onCreate with

 flowSupport = FlowDelegate.onCreate(nonConfig, getIntent(), savedInstanceState, parceler, History.single(....my history ...), this)

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

2 participants