package com.example.android_arrayadapter;import android.R.anim;import android.support.v7.app.ActionBarActivity;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.SimpleAdapter;public class MainActivity extends ActionBarActivity { private ListView listView; private ArrayAdapter<String>arrayAdapter; private SimpleAdapter simpleAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); listView=(ListView) findViewById(R.id.listView); String[]arr_data={"慕课网1","慕课网2","慕课网3","慕课网4"}; arrayAdapter=new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, arr_data); listView.setAdapter(arrayAdapter); }}
3 回答
- 3 回答
- 0 关注
- 1561 浏览
添加回答
举报
0/150
提交
取消