我的应用程序在调试模式下运行良好,但当我切换到发布模式时,会出现如下编译错误:错误:此类应提供默认构造函数(不带参数的公共构造函数)该类是
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.List;
public class CFileArrayAdapter extends ArrayAdapter<COption> {
private Context c;
private int id;
private List<COption> items;
public CFileArrayAdapter(Context context, int textViewResourceId,
List<COption> objects) {
super(context, textViewResourceId, objects);
c = context;
id = textViewResourceId;
items = objects;
}
public COption getItem(int i)
{
return items.get(i);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, null);
}
final COption o = items.get(position);
if (o != null) {
TextView t1 = (TextView) v.findViewById(R.id.TextView01);
TextView t2 = (TextView) v.findViewById(R.id.TextView02);
if(t1!=null)
t1.setText(o.getName());
if(t2!=null)
t2.setText(o.getData());
}
return v;
}
}
有人能帮我解决这个问题吗?
最后我发现了我的应用程序有什么问题。我错误地将我的所有活动包括清单中的FileArrayAdapter,它在发布模式中导致了奇怪的编译错误