List view crashing

后端 未结 5 1948
迷失自我
迷失自我 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:05

    It seems that your misused its constructor.

    Try this:

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

    In ArrayAdapter Documentaion, the third parameter should be an ID of a TextView

提交回复
热议问题