我想实现的功能是,点击GridView的Item,把数据(ImageView和TextView的值)传递到对话框中显示,现在我只实现了传递TextView的值,但是也有问题,当一屏显示不了的时候,滑动屏幕,这时候数据就乱了,程序跑飞,我用的是:
- Java code
switch(arg0.getId()){ case R.id.menugridview: GridView menugridview = (GridView) arg0; View mView = menugridview.getChildAt(arg2); TextView text1 = (TextView) mView.findViewById(R.id.view_idtv01); TextView text2 = (TextView) mView.findViewById(R.id.view_nametv01); TextView text3 = (TextView) mView.findViewById(R.id.view_pricetv01); id_d = text1.getText().toString(); name_d = text2.getText().toString(); price_d = text3.getText().toString(); }
有谁可以指点一下啊,求帮助!!
------解决方案--------------------