错误:(28)错误:此类应提供默认的构造函数(不带参数的公共构造函数)(myclassname.HelpDialog)[Instantiatable] [英] Error:(28) Error: This class should provide a default constructor (a public constructor with no arguments) (myclassname.HelpDialog) [Instantiatable]
本文介绍了错误:(28)错误:此类应提供默认的构造函数(不带参数的公共构造函数)(myclassname.HelpDialog)[Instantiatable]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在调试模式下编译时一切都很好。但是在Release配置中编译时,发生以下错误:
Everything went fine while compiling in debug mode. But while compiling in Release configuration, following error occurs :
错误:(28)错误:此类应提供默认的构造函数(公共没有参数的构造函数)(myclassname.HelpDialog)[可实例化]
Error:(28) Error: This class should provide a default constructor (a public constructor with no arguments) (myclassname.HelpDialog) [Instantiatable]
这是代码
public class HelpDialog extends Dialog {
Activity mActivity;
Button btn_go_back;
public HelpDialog(Activity mactivity) {
super();
this.mActivity = mactivity;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_help);
btn_go_back = (Button)findViewById(R.id.btn_help_go_back);
btn_go_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
}
}
推荐答案
添加此兄弟:
public HelpDialog( ){
super(null);
}
这篇关于错误:(28)错误:此类应提供默认的构造函数(不带参数的公共构造函数)(myclassname.HelpDialog)[Instantiatable]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文