安卓:获取选中的复选框值 [英] Android: Get checked checkbox values

查看:959
本文介绍了安卓:获取选中的复选框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要选中的复选框值时,单击按钮。 Java的code:

  dualcamera1 =(复选框)findViewById(R.id.C​​amera1_DualDisplay);
dualcamera2 =(复选框)findViewById(R.id.C​​amera2_DualDisplay);
dualcamera3 =(复选框)findViewById(R.id.C​​amera3_DualDisplay);
dualcamera4 =(复选框)findViewById(R.id.C​​amera4_DualDisplay);
dualdisplay =(按钮)dialog.findViewById(R.id.DisplayDualVideo);
 

解决方案

这可以帮助你:

  //返回此视图的启用状态。
dualcamera1.isEnabled()如果这一观点被启用//返回true,否则为false。

//表示鉴于当前是否处于pressed状态。
dualcamera1.is pressed()如果这一观点被启用//返回true,否则为false。
 

I need to get checked checkbox values when button clicked. Java Code:

dualcamera1 = (CheckBox)findViewById(R.id.Camera1_DualDisplay);
dualcamera2 = (CheckBox)findViewById(R.id.Camera2_DualDisplay);
dualcamera3 = (CheckBox)findViewById(R.id.Camera3_DualDisplay);
dualcamera4 = (CheckBox)findViewById(R.id.Camera4_DualDisplay);
dualdisplay = (Button)dialog.findViewById(R.id.DisplayDualVideo);

解决方案

This may help you:

//Returns the enabled status for this view. 
dualcamera1.isEnabled()  //return True if this view is enabled, false otherwise. 

//Indicates whether the view is currently in pressed state.
dualcamera1.isPressed() //return True if this view is enabled, false otherwise. 

这篇关于安卓:获取选中的复选框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆