Break line in json string java

后端 未结 3 1179
失恋的感觉
失恋的感觉 2021-01-28 07:46

Don\'t know how to express myslef very well.As you see down in my code I have a String,an ArrayList of Strings and a spinner.

In my code I add the elements of my String

3条回答
  •  [愿得一人]
    2021-01-28 08:22

    Change u r code "accounts" used two times. Make arraylist for accounts and load into spinner.

        Spinner spinner1 = (Spinner) findViewById(R.id.spinner1);
        List accountsList = new ArrayList();
        accountsList.add("one");
        accountsList.add("two");
        accountsList.add("three");
        accountsList.add("four");
    
        ArrayAdapter dataAdapter = new ArrayAdapter
                     (this,android.R.layout.simple_spinner_item,accountsList);
    
        dataAdapter.setDropDownViewResource
                     (android.R.layout.simple_spinner_dropdown_item);
    
        spinner1.setAdapter(dataAdapter);
    
        // Spinner item selection Listener  
        addListenerOnSpinnerItemSelection();
    
        // Button click Listener 
        addListenerOnButton();
    

    Follow this Tutorial

提交回复
热议问题