首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android程序起动界面

2012-06-28 
android程序启动界面一个很简单的例子:程序启动界面?主要code:package com.ssx.startload?brimport and

android程序启动界面
    一个很简单的例子:程序启动界面
?
主要code:
package com.ssx.startload;
?
<br>import android.app.activity;<br>import android.content.intent;<br>import android.os.bundle;<br>import android.os.handler;<br>import android.os.message;<br>import android.view.window;<br>import android.view.windowmanager;
public class startloadactivity extends activity {<br>?/** called when the activity is first created. */<br>??public static final int continue = 0x108;<br>??public static final int update = 0x109;<br>??final handler handler = new handler() {<br>???@override<br>???public void handlemessage(message msg) {
????switch (msg.what) {<br>????case startloadactivity.continue:
?????intent it = new intent();<br>?????it.setclass(startloadactivity.this, mainactivity.class);<br>?????startactivity(it);<br>?????finish();<br>?????break;<br>????}<br>????super.handlemessage(msg);<br>???}
??};
??@override<br>??public void oncreate(bundle savedinstancestate) {<br>???super.oncreate(savedinstancestate);<br>???getwindow().setflags(windowmanager.layoutparams.flag_fullscreen,<br>?????windowmanager.layoutparams.flag_fullscreen);<br>???requestwindowfeature(window.feature_no_title);<br>???setcontentview(r.layout.start_loading);<br>???//handler.sendemptymessage(startloadingactivity.continue);<br>??thread sleepthread = new thread() {<br>????public void run() {
?????try {<br>??????thread.sleep(5000);//设置启动欢迎界面时间<br>??????intent it = new intent();<br>??????it.setclass(startloadactivity.this, mainactivity.class);<br>??????startactivity(it);<br>??????handler.sendemptymessage(startloadactivity.continue);<br>?????} catch (interruptedexception e) {<br>??????// todo auto-generated catch block<br>??????e.printstacktrace();<br>??????handler.sendemptymessage(startloadactivity.continue);<br>?????}<br>????}<br>???};<br>???sleepthread.start();<br>??}<br>?}
?
 

热点排行