hi i am creating a listview with checkbox. if i define data in class itself it is working but i want to access the data from string.xml file and i am using the following code. please suggest me solution how to access it
public class ListTestActivity extends ListActivity {
/** Called when the activity is first created. */
String tag = "Events";
String[] presidents;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create an array of Strings, that will be put to our ListActivity
presidents =getResources().getStringArray(R.array.presidents_array);
ArrayAdapter<Model> adapter = new InteractiveArrayAdapter(this,
getModel());
Log.d(tag," event");
setListAdapter(adapter);
}
private List<Model> getModel() {
Log.d(tag,"bht");
List<Model> list = new ArrayList<Model>();
list.add(get("Linux"));///
here i want to access the strings.xml file instead of this any suggestion
Log.d(tag,"bht1");
list.add(get("Windows7"));
list.add(get("Suse"));
list.add(get("Eclipse"));
list.add(get("Ubuntu"));
list.add(get("Solaris"));
list.add(get("Android"));
list.add(get("iPhone"));
// Initially select one of the items
list.get(1).setSelected(true);
Log.d(tag," event1");
return list;
}
private Model get(String s) {
Log.d(tag," event2");
return new Model(s);
}
}