When the Android App is started, the image is being loaded (source code ),

Source: Internet
Author: User

When the Android App is started, the image is being loaded (source code ),

, QQ, beautiful every day and other programs, displayed an image, and then jump to the relevant interface. This function is actually very simple ....

 

Create two new activities, LoadingActivity and MainActivity. Set LoadingActivity to android. intent. action. MAIN. Use TimerTesk or Thread to display LoadingActivity for several seconds and then jump to the MainActivity interface.

 

LoadingActivity:

new Timer().schedule(new TimerTask() {@Overridepublic void run() {startActivity(new Intent(LoadingActivity.this, MainActivity.class));finish();overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);}}, 2000);

Set the LoadingActivity Style

<style name="customLoading">        <item name="android:windowFullscreen">true</item>        <item name="android:windowContentOverlay">@null</item>        <item name="android:windowNoTitle">true</item>        <item name="android:background">@drawable/loading</item></style>

Yes... of course there are many implementation methods. You should find them online.

 

Source code: http://download.csdn.net/detail/tangcheng_ OK /7616001

Original article, reproduced please indicate the source: http://blog.csdn.net/tangcheng_ OK





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.