Android手机软件开发界面跳转一例
Android手机软件开发界面跳转一例
开发环境配置:
window server 2008
Eclipse 3.7
JDK1.6
Android2.2
ADT14
//应用程序配置xml文件
//AndroidManifest.xml
//--------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="LC.HelloWorld"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".SecPage"
android:label="@string/app_name">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:label="@string/app_name"
android:name=".HelloWorldActivity" >
</activity>
<activity
android:label="@string/app_name"
android:name=".OtherActivity" >
</activity>
</application>
</manifest>
//手机界面布局xml文件
res/layout/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" >
<TextView
android:id="@+id/txt_display"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<TextView
android:id="@+id/myTextView"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:text="TextView" />
<Button
android:id="@+id/myButton"
android:layout_width="fill_parent"
android:layout_height="69dp"
android:text="Button" />
</LinearLayout>
res/layout/other.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" >
<TextView
android:id="@+id/myTextView2"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:text="TextView" />
<Button
android:id="@+id/btn_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="back回退" />
</LinearLayout>
res/values/strings.xml
//-------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, HelloWorldActivity!</string>
<string name="app_name">HelloWorld</string>
<string name="other">otherActivity</string>
</resources>
//源代码
//SecPage.java
//-------------------------------------------------------------------------
package LC.HelloWorld;
import android.app.Activity; //是Activity所在的包
import android.content.DialogInte易做图ce;
import android.content.DialogInte易做图ce.OnClickListener;
import android.content.Intent;
import android.os.Bundle; //用于映射字符串的值
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
补充:移动开发 , Android ,