problem filling string[] with string-array from strings.xml

后端 未结 3 805
别那么骄傲
别那么骄傲 2021-01-22 19:32

EDIT: woah ... somehow i replaced this question with another one i was asking, glad there is this rollback feature

this specific question deals with the

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-22 20:10

    suggest not to define an array in advance, and used directly without defining a variable

    mAutoComplete.setAdapter (new ArrayAdapter(this, android.R.layout.simple_dropdown_item_1line, getResources().getStringArray(R.array.OmskStreets)));
    

    and more..

    in Class

    private String[] mStreets = null;
    

    and in onCreate method

    mStreets = getResources().getStringArray(R.array.OmskStreets);
    

提交回复
热议问题