Closed ProgrammationAndroid closed 7 years ago
Thank you for reporting the crash. This crash can be handled in the app code as follows:
Add this line to your activity
tag in AndroidManifest.xml.
android:configChanges="orientation|screenSize"
Add below code in your Activity/Fragment which inflates the AAH_FabulousFragment
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (dialogFrag.isAdded()) {
dialogFrag.dismiss();
dialogFrag.show(getActivity().getSupportFragmentManager(), dialogFrag.getTag()); //remove this line if you want to just hide the dialog on config change
}
}
Check the updated example to see it working.
Actually, i handled that directly in onSaveInstanceState method where i check if the Dialog is displaying.
Also, what do you think of adding a listener when the fab's animations end ? I tested quickly and it seems pretty "logical" to wait the end of the fab animation before launch a new request with the filters.
Anyway, nice work ;).
I just added callbacks for animations, update to version 0.0.3 and check MainActivity/MyFabFragment for example. Also adding it to README file.
Nice ;). Gonna try this ;)
Okay, Closing this issue. Feel free to re-open if necessary.
Hi ;). I notice an error while playing with your library. Nice work by the way !
To Reproduce, Just Launch "Top Fab Demo" and while the Filters Fragment is open, rotate your phone. The app Crash with a Null Pointer Exception due to the Floating Action Button
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.design.widget.FloatingActionButton.getLocationInWindow(int[])' on a null object reference at com.allattentionhere.fabulousfilter.AAH_FabulousFragment.setupDialog(AAH_FabulousFragment.java:129)
Bye ;)