如何在布局中设置一个可绘制对象以使用列表视图?这是我的代码和功能,但我无法点击项目:
public class ListMobileActivity extends Activity {
static final String[] Ristoranti = new String[] { "Osteria Mingot", "Cecchini", "Barrique", "Mediterraneo"};
ListView listView1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list);
ListView listView1 = (ListView) findViewById(R.id.listView);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_mobile, R.id.label, Ristoranti);
listView1.setAdapter(adapter);
}