List view crashing

后端 未结 5 1917
迷失自我
迷失自我 2021-01-06 12:48

I am trying to create ListView and fill it with data , but when i launch the application crashes and shows me a message

Unfortunately,…

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-06 13:03

    Change:

    ArrayAdapter value = new ArrayAdapter(this,
           android.R.layout.simple_list_item_1, R.id.mylist, actions);
    

    To this:

    ArrayAdapter value = new ArrayAdapter(this,
           android.R.layout.simple_list_item_1, android.R.id.text1, actions);
    
    //OR
    
    ArrayAdapter value = new ArrayAdapter(this,
           android.R.id.text1, actions);
    

提交回复
热议问题