Error: This class should provide a default constructor (a public constructor with no arguments) [Instantiatable]
Error: This class should provide a default constructor (a public constructor with no arguments) [Instantiatable]
在调试模式下编译时一切正常。但是在发布配置中编译时,出现以下错误:
Error: This class should provide a default constructor (a public constructor with no arguments) (tb.lo.MyTabFactory) [Instantiatable]
这是代码:
public class MyTabFactory implements TabContentFactory {
private final Context mContext;
public MyTabFactory(Context context) {
mContext = context;
}
public View createTabContent(String tag) {
View v = new View(mContext);
v.setMinimumWidth(0);
v.setMinimumHeight(0);
return v;
}
}
按照错误提示添加以下构造函数。应该可以。
public MyTabFactory() {
}
在调试模式下编译时一切正常。但是在发布配置中编译时,出现以下错误:
Error: This class should provide a default constructor (a public constructor with no arguments) (tb.lo.MyTabFactory) [Instantiatable]
这是代码:
public class MyTabFactory implements TabContentFactory {
private final Context mContext;
public MyTabFactory(Context context) {
mContext = context;
}
public View createTabContent(String tag) {
View v = new View(mContext);
v.setMinimumWidth(0);
v.setMinimumHeight(0);
return v;
}
}
按照错误提示添加以下构造函数。应该可以。
public MyTabFactory() {
}