我正在使用simple_list_item_checkedlistview并以编程方式将checked设置为true/false.但是,当用户从列表中选择项目时,它会更改复选框的状态.
它只显示一秒钟,因为它会立即重定向到另一个活动.
如何在用户点击复选框时阻止复选框的更改?
我有一个包含一堆微调器的列表视图,但是当我滚动列表视图时,微调器的值被重置.有没有办法来解决这个问题?这就是我的ArrayAdapter类的样子.
公共类ProductArrayAdapter扩展ArrayAdapter {private final Context context;
private final List<Product> values;
public ProductArrayAdapter( Context context, List<Product> values ) {
super( context, R.layout.product_item, values );
this.context = context;
this.values = values;
}
@Override
public View getView( int position, View convertView, ViewGroup parent ) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
View rowView = inflater.inflate( R.layout.product_item, parent, false );
Product availableProduct = values.get( position );
((TextView) rowView.findViewById( R.id.productCode )).setText( Product.getProductName( availableProduct.getProductCode( ) ) );
((Spinner) rowView.findViewById( R.id.count )).setAdapter( productCounts );
return rowView; …Run Code Online (Sandbox Code Playgroud)