提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
提示:以下是本篇文章正文内容,下面案例可供参考
一、创建项目
二、使用步骤
1.引入库
1:显示第一个页面停留3秒并跳转
代码如下(示例):
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_launcher"
tools:context=".BarActivity" >
</LinearLayout>
2:通过Java代码实现全屏和显示3秒后自动跳转
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
protected void onCreate(Bundle savedInstanceState) {
// 开启一个线程
Thread t = new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
try {
// 等待3秒
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// 启动第二页面
Intent it = new Intent(getApplicationContext(),
LonginActivity.class);
startActivity(it);
}
});
t.start();
}
2.编辑用户注册页面
1:代码如下(示例):
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".LiuActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="用户注册"
android:gravity="c