我正在检索数据(用户信息),并从一个HashMap
到ArrayAdpater
(在列表视图中)显示它。每当我在列表视图上单击(甚至滚动)时,我的应用程序都会崩溃。
知道为什么会这样吗?这就是我正在做的事情:
//..
Handler handler = new Handler();
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_app_activity3);
information=new String[50];
Intent intent = getIntent();
Custom custom = (Custom) intent.getSerializableExtra("custom");
HashMap<String, String> list = custom.getList();
//Set s = list.entrySet();
Iterator items=list.values().iterator();
int i=0;
while (items.hasNext())
{
information[i]=(String) items.next();
System.out.println(information[i]);
i++;
}
lv = (ListView)findViewById(R.id.listview1);
lv.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,information));
lv.setTextFilterEnabled(true);
}
这是我的Logcat:
system.NativeStart.main(Native Method) 01-22 22:45:22.496: I/Process(332): 发送信号。PID:332 SIG:9