欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android編程實(shí)現(xiàn)啟動界面的方法分析

 更新時(shí)間:2017年03月06日 11:43:26   作者:羅瑜  
這篇文章主要介紹了Android編程實(shí)現(xiàn)啟動界面的方法,結(jié)合實(shí)例形式分析了Android啟動界面的實(shí)現(xiàn)方法與相關(guān)操作技巧,需要的朋友可以參考下

本文實(shí)例講述了Android編程實(shí)現(xiàn)啟動界面的方法。分享給大家供大家參考,具體如下:

最近在弄一個(gè)程序啟動界面程序,在這里貼下代碼。解釋一下:后面Intent(qidong.this,"寫想要跳轉(zhuǎn)的Activity");

效果圖:

然后建立一個(gè)名字為qidon。

Activity:

import Android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class qidong extends Activity{
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    new Handler().postDelayed(new Runnable(){ // 為了減少代碼使用匿名Handler創(chuàng)建一個(gè)延時(shí)的調(diào)用
      public void run() {
        Intent i = new Intent(qidong.this, Quwenapk.class); //通過Intent打開最終真正的主界面Main這個(gè)Activity
        qidong.this.startActivity(i); //啟動Main界面
        qidong.this.finish(); //關(guān)閉自己這個(gè)開場屏
      }
    }, 5000); //5秒,夠用了吧
  }
}

main.xml代碼

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:background="@drawable/qt800x480"
  >
<TextView
  android:id="@+id/qidong"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textSize="15dip"
  android:layout_centerHorizontal="true"
  android:text="程序加載中.."
  android:layout_marginTop="250.dip"
  android:layout_marginLeft="90.dip"
  />
</RelativeLayout>

OK這樣就可以了。

更多關(guān)于Android相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Android開發(fā)入門與進(jìn)階教程》、《Android調(diào)試技巧與常見問題解決方法匯總》、《Android多媒體操作技巧匯總(音頻,視頻,錄音等)》、《Android基本組件用法總結(jié)》、《Android視圖View技巧總結(jié)》、《Android布局layout技巧總結(jié)》及《Android控件用法總結(jié)

希望本文所述對大家Android程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論