这是我到目前为止所拥有的.我研究了Date_Class.java中的命令,它说应该显示当前日期.但是,当我启动Android应用程序时,没有任何显示.为什么是这样?我的代码有错吗?我做错了什么?
任何有关这方面的帮助将不胜感激.谢谢.
activity_main.xml中
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- Header -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#000000"
android:textColor="#FFFFFF"
android:gravity="center"
android:layout_marginTop="20dp"
android:id="@+id/Header"
android:text=""
/>
<!-- Name -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:id="@+id/Name"
android:text=""
/>
<!-- Project Name -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:id="@+id/ProjectName"
android:text=""
/>
<!-- Digital Clock -->
<DigitalClock
android:id="@+id/DigitalClock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:text=""
/>
<!-- Calendar -->
<TextView
android:id="@+id/stringCalendar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:text=""
/>
<!-- End of Program -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:background="#000000"
android:gravity="center"
android:id="@+id/EndOfProgram"
android:text="" …Run Code Online (Sandbox Code Playgroud) 这是我到目前为止,但我显然是一个错误.
try
{
dblNights = Convert.ToDouble(txtNights.Text);
if (dblNights > 1 && 14)
{
}
else
{
string script = "alert(\"Number of Nights Must be between 1 and 14!\");";
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true);
txtNights.Focus();
}
}//End Try
catch
{
string script = "alert(\"Number of Nights Must be an Integer!\");";
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true);
txtNights.Focus();
}//End Catch
Run Code Online (Sandbox Code Playgroud)
如果输入1-14之外的数字,我不太清楚如何显示错误框.其他一切都在起作用,就是这样.我究竟做错了什么?
谢谢.