【发布时间】:2013-01-19 00:47:52
【问题描述】:
这是另一个类的 Intent,名称 product 包含来自 sqlite 数据库的数据。
我的问题是我想在 ListView 上显示信息,但我不知道该怎么做。
Intent updateCustomerIntent = getIntent();
String product = updateCustomerIntent.getStringExtra("product");
Log.d("checking........", product);
我试过了
ListView listView = (ListView) findViewById(R.id.mylist);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, android.R.id.text1, product);
listView.setAdapter(adapter);
但它给了我错误
我会感谢你的帮助。
【问题讨论】:
-
请添加您遇到的错误。
-
谢谢我得到了正确的答案汤姆 :)
-
当然可以,但如果其他用户遇到与您相同的问题,将来查找它会很有用:)