You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.IllegalStateException:
at com.jaredrummler.android.colorpicker.ColorPickerDialog.onColorSelected (ColorPickerDialog.java:583)
at com.jaredrummler.android.colorpicker.ColorPickerDialog.access$000 (ColorPickerDialog.java:68)
at com.jaredrummler.android.colorpicker.ColorPickerDialog$2.onClick (ColorPickerDialog.java:190)
at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage (AlertController.java:167)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:154)
at android.app.ActivityThread.main (ActivityThread.java:6816)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1565)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1453)
The text was updated successfully, but these errors were encountered:
FYI:
Sometimes: Activity activity = getActivity()
doesn't work correctly.
It can failed when fragment is detached from activity.
Such situations occure very! often (at least in my code for example :-) )
For resolving the issue you can implement next functionality in Your ColorPickerDialog source:
public interface ActivityEnabledListener {
void onActivityEnabled(FragmentActivity activity);
}
and then replace using getActivity() method with following code:
getAvailableActivity(new ActivityEnabledListener() {
@Override
public void onActivityEnabled(FragmentActivity activity) {
// You can use activity object safely here
}
});
panovvitalik
changed the title
Crash
Application crashing... Fatal Exception: java.lang.IllegalStateException: The activity must implement ColorPickerDialogListener
Nov 2, 2019
panovvitalik
changed the title
Application crashing... Fatal Exception: java.lang.IllegalStateException: The activity must implement ColorPickerDialogListener
Application crashing... Fatal Exception: java.lang.IllegalStateException
Nov 2, 2019
Version: 1.0.5
Samsung Galaxy J2 (j2y18lte), Android 7.1
Report 1 of 1
java.lang.IllegalStateException:
at com.jaredrummler.android.colorpicker.ColorPickerDialog.onColorSelected (ColorPickerDialog.java:583)
at com.jaredrummler.android.colorpicker.ColorPickerDialog.access$000 (ColorPickerDialog.java:68)
at com.jaredrummler.android.colorpicker.ColorPickerDialog$2.onClick (ColorPickerDialog.java:190)
at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage (AlertController.java:167)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:154)
at android.app.ActivityThread.main (ActivityThread.java:6816)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1565)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1453)
The text was updated successfully, but these errors were encountered: