If you want the values of string array to listview.
private String [] fiilliste={"A","Ağlamak","Almak","B","Bulmak"};
ArrayAdapter<String> adapter;
adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, fiilliste);
vlist.setAdapter(adapter);
And wanna use xml file for string-array. <?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="fi">
<item>A</item>
<item>Almak</item>
<item>Anlamak</item>
<item>Anlasmak</item>
<item>Anlatmak</item>
<item>Ayrilmak</item>
</string-array>
</resources>
So you just have to do like this:String [] fiilliste;
ArrayAdapter<String> adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.verbs);
fiilliste = getResources().getStringArray(R.array.fi);
// move this in onCreate
No comments:
Post a Comment