android中CheckBox使用方法
来源:互联网 发布:易语言 数组对比 编辑:程序博客网 时间:2024/06/06 09:28
JAVA文件:
package com.control;import android.app.Activity;import android.os.Bundle;import android.widget.CheckBox;import android.widget.CompoundButton;import android.widget.Toast;public class MyActivity extends Activity { CheckBox mCheckBox; /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mCheckBox = (CheckBox) findViewById(R.id.get_test_checkbox); mCheckBox.setChecked(false); //mCheckBox.setClickable(false); mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){ public void onCheckedChanged(android.widget.CompoundButton compoundButton, boolean b){ Toast.makeText(MyActivity.this,"a="+mCheckBox.isChecked()+ " b="+b,Toast.LENGTH_LONG).show(); } }); }}
main.xmll布局文件
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Hello World, MyActivity" /> <CheckBox android:id="@+id/get_test_checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" /></LinearLayout>
- android中CheckBox使用方法
- Android程序:checkbox的使用方法
- android CheckBox控件的简单使用方法
- PowerBuilder 8.0中ListBox的CheckBox使用方法。
- PowerBuilder 8.0中ListBox的CheckBox使用方法。
- c#中datagridview里checkbox的使用方法
- EXTJS中Gridpanel加载checkbox的使用方法
- cocos2d-x中ccui.checkbox的使用方法
- C# winfrom 中datagridview中checkbox的使用方法
- android+listView中嵌入checkbox
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- android中checkbox自定义样式
- Android中自定义checkbox样式
- Android中自定义checkbox样式
- Android中自定义CheckBox样式
- Android中自定义CheckBox样式
- Android中自定义checkbox样式
- c语言的操作符共有15个优先级,如下:
- RS232/485/422、USB----传输距离
- InterBase数据库文件损坏的修复方法
- 关于line-height的特性研究
- 关于VS2010的错误:mt.exe : general error c101008a
- android中CheckBox使用方法
- 监控一个进程是否在执行
- VS2010不能将参数 1 从“std::string”转换为“const char *”解决
- 一起来玩WebApp第1篇---配置开发环境(下)
- 在运行里面输入cmd,结果出来的命令提示符是白色的,而且还显示中文乱码
- v2lin
- 支持存储的开源KV缓存方案Membase和Redis特性比较
- iphone 无证书真机调试
- Navicat For SQLite