D
D
dearname2014-02-11 17:31:12
Android
dearname, 2014-02-11 17:31:12

Why is it crashing in a simple list view (ListView)?

Good evening, for some reason I crash in the usual filling of the list. I did everything according to the book, it still does not work. The environment itself does not give errors, but crashes when launched in the emulator.

public class QuizMenuActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.menu);
    ListView menuList = (ListView) findViewById(R.id.listView12);
    String[] items = {"Маша"};
    
    ArrayAdapter<String> adapt = new ArrayAdapter<String>(this,R.layout.menu_item, items);
    menuList.setAdapter(adapt);
  }

}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2014-02-11
@dearname

What eksepshn issues at least specify. And are you sure menuList exists?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question