First, let's take a look at the startup screen of the software "Hand score. As follows:
In fact, the working principle of the welcome interface is very simple, that is, to start a thread in the oncreate function, the thread body jumps after several seconds of sleep
To mainactivity. The specific implementation code is as follows:
Welcomeactivity. Java
Import android. app. activity; import android. content. intent; import android. OS. bundle; import android. OS. handler; import android. OS. message; import android. view. window; import android. view. windowmanager;/** @ Author: zhenghaibo * Web: http://blog.csdn.net/nuptboyzhb * mail: zhb931706659@126.com * 2013-3-25 Nanjing, njupt, China */public class welcomeactivity extends activity {Private Static final int goto_main_activity = 0; @ overridepublic void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); // you can specify the value of requestwindowfeature (window. feature_no_title); // sets full screen getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen); setcontentview (R. layout. activity_welcome); mytimer timer = new mytimer (); timer. start (); // start thread} handler mhandler = new handler () {public void handlemessage (Message MSG) {Switch (MSG. what) {Case goto_main_activity: intent = new intent (); intent. setclass (welcomeactivity. this, systemmain. class); startactivity (intent); finish (); break; default: Break ;};}; public class mytimer extends thread {public mytimer () {// todo auto-generated constructor stub} @ overridepublic void run () {// todo auto-generated method stubtry {thread. sleep (3000); // thread pause time, in milliseconds mhandler. sendemptymessage (goto_main_activity);} catch (interruptedexception e) {// todo auto-generated catch blocke. printstacktrace ();}}}}
Layout code activity_welcome.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="horizontal"android:background="@drawable/welcome"xmlns:android="http://schemas.android.com/apk/res/android"></LinearLayout>
By the way, if you advertise your ads, you will develop your own score. Thank you for your support! I will write about the implementation of Image Processing in the software in the future, so stay tuned!