Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 |
Tags
- 코드 리뷰
- spring bean
- 톰캣
- tomcat
- spring batch 코드
- spring-webmvc #코드읽기
- spring jpa
- JPA mapping
- spring boot tomcat
- SuperTypeToken
- 세미나
- Spring Data REST
- ApplicationPidFileWriter
- spring camp
- docker
- Spring Data JPA
- spring pid
- Spring
- Spring Batch
- spring boot
- JPA
- static inner class
- spring-webmvc
- ORM
- Data REST
- IntelliJ
- batch
- spring-mvc
- JUnit
- REST API
- Today
- 1
- Total
- 916,386
woniper
[Android] 어플리케이션 로딩화면(Splash) 구현하기 본문
이번 포시팅은 앱의 로딩 화면을 몇초 동안 띄우고 그 후에 앱을 사용할 수 있는 것이다.
예를 들면 아래와 같이 국민앱인 카카오톡과 같이 카톡을 처음 실행하면 아래 이미지가 로딩된 후 카톡을 사용할 수 있다.
로딩의 장점이라면 로딩하는 시간동안 앱의 기본 설정을 셋팅 할 수 있고, 홍보(?) 효과도 있는것 같다.
자 이제 소스를 보자
레이아웃은 다른 activity 레이아웃과 같이 로딩하고 싶은 이미지로된 레이아웃을 하나 만든다.
import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.View; import android.view.animation.AnimationUtils; import android.widget.ImageView; public class SplashActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); Handler hd = new Handler(); hd.postDelayed(new splashhandler() , 3000); // 3초 후에 hd Handler 실행 } private class splashhandler implements Runnable{ public void run() { startActivity(new Intent(getApplication(), MainActivity.class)); // 로딩이 끝난후 이동할 Activity SplashActivity.this.finish(); // 로딩페이지 Activity Stack에서 제거 } } }별로 어렵지 않은 소스다. 끄읏~
'Android' 카테고리의 다른 글
Android Intent를 이용한 Activity간 Data 공유 (4) | 2014.08.02 |
---|---|
Android XML Selector 생성 및 적용하기 (5) | 2014.08.02 |
[안드로이드]AsyncTask 설명 (1) | 2013.04.12 |
6 Comments