简体   繁体   English

不兼容的类型:活动无法转换为 OnDateSetListener

[英]incompatible types: Activity cannot be converted to OnDateSetListener

error: incompatible types: FragmentActivity cannot be converted to OnDateSetListener.callback(getActivity())错误:类型不兼容:FragmentActivity 无法转换为 OnDateSetListener.callback(getActivity())

new SpinnerDatePickerDialogBuilder()
            .context(getActivity())
            .callback(getActivity())
            .spinnerTheme(R.style.NumberPickerStyle)
            .showTitle(true)
            .showDaySpinner(true)
            .defaultDate(2000, 0, 1)
            .maxDate(Integer.parseInt(temp), 0, 1)
            .minDate(1950, 0, 1)
            .build()
            .show();

your fragment must implement interface OnDateSetListener and set您的片段必须实现接口 OnDateSetListener 并设置
SpinnerDatePickerDialogBuilder SpinnerDatePickerDialogBuilder

new SpinnerDatePickerDialogBuilder()
            .context(getActivity())
            .callback(this)
            .spinnerTheme(R.style.NumberPickerStyle)
            .showTitle(true)
            .showDaySpinner(true)
            .defaultDate(2000, 0, 1)
            .maxDate(Integer.parseInt(temp), 0, 1)
            .minDate(1950, 0, 1)
            .build()
            .show();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:不兼容的类型:MainFragment 无法转换为 Activity - error: incompatible types: MainFragment cannot be converted to Activity JAVA 不兼容类型......“无法转换为” - JAVA incompatible types ... "cannot be converted to" 不兼容的类型,无法转换为 int - Incompatible types, cannot be converted to int 不兼容的类型不能转换为片段 - Incompatible types cannot be converted to Fragment 无法将 Java 代码集成到我的 React Native 项目中 - 错误:类型不兼容:ReactApplicationContext 无法转换为 Activity - Unable to integrate java code to my react native project - error: incompatible types: ReactApplicationContext cannot be converted to Activity 错误:类型不兼容:不能将double转换为JTextField - Error: incompatible types: double cannot be converted to JTextField 错误:类型不兼容:无法将Integer转换为Integer [] - Error: incompatible types: Integer cannot be converted to Integer[] 错误:类型不兼容:int [] []无法转换为int - error: incompatible types: int[][] cannot be converted to int 错误:不兼容的类型:消息无法转换为 int? - Error: incompatible types: Message cannot be converted to int? 不兼容的类型:单一<HttpServer>无法转换为 Completable - incompatible types: Single<HttpServer> cannot be converted to Completable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM