android启动界面定时跳转
来源:互联网 发布:mac的输入法快捷键 编辑:程序博客网 时间:2024/06/05 18:07
1、
public class IndexActivity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_index);// 加入定时切换界面功能Thread t = new Thread() {@Overridepublic void run() {// 定时try {Thread.sleep(2000);// 切换下一个界面Intent in = new Intent(IndexActivity.this,MainActivity.class);startActivity(in);// 当切换到下一个界面后,当前封面就关闭了finish();} catch (Exception e) {e.printStackTrace();}}};t.start();}}
完成主界面即可。
<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/main_bg" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="55" android:background="@drawable/top_bg" android:orientation="horizontal" android:paddingBottom="5dp" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="5dp" > <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" /> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="7" android:gravity="center" android:text="程序员面试宝典" android:textColor="#ffffff" android:textSize="14sp" /> <Button android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/top_setting_btn" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="665" android:orientation="vertical" > <TextView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="80" /> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="200" android:orientation="horizontal" > <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" /> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/main_book_icon" /> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" /> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="52" /> <TextView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="58" android:gravity="center" android:textSize="30sp" android:text="欢迎使用" android:textColor="#ff0000" /> <TextView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="80" /> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="115" android:orientation="horizontal" > <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="38" /> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="404" android:background="@drawable/main_adv_icon" /> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="38" /> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="80" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="80" android:orientation="horizontal" android:paddingBottom="10dp" android:paddingTop="10dp" > <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" /> <LinearLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="3" android:background="@drawable/bottom_bg" android:paddingBottom="5dp" android:paddingTop="5dp" > <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="0.5" /> <Button android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/bottom_01_b" /> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1.5" /> <Button android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/bottom_02_a" /> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1.5" /> <Button android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/bottom_03_a" /> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="0.5" /> </LinearLayout> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" /> </LinearLayout></LinearLayout>
0 0
- android启动界面定时跳转
- Android中APP启动界面定时跳转(Handler,Timer)
- Android启动界面自动跳转
- Android启动页面定时跳转的三种方法
- Android启动页面定时跳转的三种方法
- Android启动页面定时跳转的三种方法
- android 页面定时跳转
- Android TimerTask定时跳转
- android 跨应用跳转 启动其他应用指定界面
- Android 跳转手机管家的自启动界面
- android定时刷新界面
- android定时刷新界面
- Android - Intent - 界面跳转
- Android - Intent - 界面跳转
- Android实现界面跳转
- Android Activity界面跳转
- android 跳转卸载界面
- android界面跳转
- 黑马程序员java基础String、StringBuffer、StringBuilder笔记
- x264 - x264_reference_build_list
- 带有头结点的循环单链表的相关操作
- tomcat从 http转成https,并且去掉端口号
- 【尚观】Android游戏与应用开发最佳学习之路_转载来学习Android
- android启动界面定时跳转
- asp.net中前台限制TextBox文本框只能输入数字和小数(或数字和字母)
- x264 - x264_reference_check_reorder
- virtual函数调用例题
- vc下库文件的编写和调用
- Spring中获得bean的方法
- 怎样往eclipse导入jsp系统
- GetDeviceCaps获取与修改显示器属性
- x264 - x264_reference_update