Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question