- App을 시작하기전 Intro 화면을 띄우는 예제이다.
- Intro를 통해 App을 간단하고 명확하게 소개 및 설명 할 수 있다.
-Java 소스
- Intro를 통해 App을 간단하고 명확하게 소개 및 설명 할 수 있다.
-Java 소스
public class Intro extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.intro);
new Thread(new Runnable() {
public void run() {
// TODO Auto-generated method stub
try {
Thread.sleep(2000);
} catch (Throwable ex) {
ex.printStackTrace();
}
Intent i = new Intent(Intro.this, IntroexamActivity.class);
startActivity(i);
finish();
}
}).start();
}
}
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
public class IntroexamActivity extends Activity { //인트로 후 메인
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
-------------------------------------------------------------------------------------------------------- - xml 소스
<!--intro.xml-->
<?xml version="1.0" encoding="utf-8"?>
-------------------------------------------------------------------------------------------------------- - xml 소스
<!--intro.xml-->
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/intro"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY"
android:src="@drawable/ic_launcher" >
</ImageView>
</LinearLayout>
-------------------------------------------------------------------------------------------------------
<!--main.xml-->
<?xml version="1.0" encoding="utf-8"?>
-------------------------------------------------------------------------------------------------------
<!--main.xml-->
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>
--------------------------------------------------------------------------------------------------------- AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
--------------------------------------------------------------------------------------------------------- AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Introexam.org"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".Intro"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".IntroexamActivity"
android:label="@string/app_name" >
</activity>
</application>
</manifest>
------------------------------------------------------------------------------------------------------- - 실행 화면
------------------------------------------------------------------------------------------------------- - 실행 화면
'JAVA > Android' 카테고리의 다른 글
안드로이드 화면 크기 구하기 예제 따라하기 (0) | 2012.02.20 |
---|---|
안드로이드 DB 오름차순,내림차순 예제 따라하기 (0) | 2012.02.17 |
안드로이드 E-Mail 보내기 예제 따라하기 (10) | 2012.02.15 |
안드로이드 ViewFlipper(터치로 화면넘기기) 예제 따라하기 (4) | 2012.02.14 |
안드로이드 WebView에 Progress바 달기 두번째 예제 따라하기 (0) | 2012.02.09 |