Programming Implementation of the android welcome interface [shouxiangscoring-software instance]

Source: Internet
Author: User


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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.