Why am I getting errors while calling context.getResources().getString(R.string.string) in my class? Using
context.getResources().getString(R.string.january);
just gives me
android.content.res.Resources$NotFoundException: String resource ID #0x7f06002e
Heres the complete class:
public class CustomCursorAdapter extends CursorAdapter{
@SuppressWarnings("deprecation")
public CustomCursorAdapter(Context context, Cursor c){
super(context, c);
}
@Override
public View newView(Context context, Cursor c, ViewGroup parent){
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
View returnView = inflater.inflate(R.layout.row, parent, false);
return returnView;
}
public void bindView(View v, Context context, Cursor c){
TextView firstname, surname, bday;
firstname = (TextView) v.findViewById(R.id.firstnameTextView);
firstname.setText(c.getString(c.getColumnIndex(c.getColumnName(1))));
surname = (TextView) v.findViewById(R.id.surnameTextView);
firstname.append(" " + c.getString(c.getColumnIndex(c.getColumnName(2))));
bday = (TextView) v.findViewById(R.id.datepickerTextView);
bday.setText("\n" + context.getResources().getString(R.string.january));
}
}
Why am I getting this error?