我希望能够将数据从一个活动转移到另一个活动.如何才能做到这一点?
我在xml文件中创建了一个checkBox.我试图在checkBox的文本上设置onClickListener但是我找不到真正的解决方案.换句话说,我希望能够单击复选框(使复选框可选)以及单击文本以使用协议期限打开新活动.谢谢.
main.xml中
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I agree to the Terms of Agreement."
android:textColor="#CC000000"
android:checked="true"/>
Run Code Online (Sandbox Code Playgroud)
这是我尝试的以下代码,但它只会导致它崩溃.
CheckBox checkBox1 = (CheckBox) findViewById(R.id.checkBox1);
Button termsOfAgreement = (Button) checkBox2.getText();
....
termsOfAgreement.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
//Launch activity
}
});
Run Code Online (Sandbox Code Playgroud) 我的asp.net 的母版页。我已经添加了为我的菜单创建子菜单下拉菜单所需的内容。不知何故它不起作用。
<%@ Import Namespace="System.Web.Optimization" %>
<!DOCTYPE html>
<html lang="en">
<head id="Head1" runat="server">
<title>Navbar Template for Bootstrap</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Sample page to include Bootstrap and Web API to Asp.Net forms application.">
<meta name="author" content="Sree">
<link href="Content/bootstrap-theme.css" rel="stylesheet" />
<link href="Content/bootstrap-theme.min.css" rel="stylesheet" />
<link href="Content/bootstrap.css" rel="stylesheet" />
<link href="Content/bootstrap.min.css" rel="stylesheet" />
<script src="Scripts/bootstrap.js"></script>
<script src="Scripts/bootstrap.min.js"></script>
<script src="Scripts/jquery-2.1.1.intellisense.js"></script>
<script src="Scripts/jquery-2.1.1.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<asp:ContentPlaceHolder ID="StyleSection" runat="server" />
<script> …Run Code Online (Sandbox Code Playgroud)