안드로이드 개발 질문/답변
(글 수 45,052)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rootLinear"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:id="@+id/splashImage"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<TextView android:text="Hello World"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
위와 같이 페이지가 구성되어 있고
어플 실행 시 ImageView에 splash.png라는 이미지를 보여주고
특정 작업을 한 뒤 제거하려고 합니다.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
splashImage = (ImageView) findViewById(R.id.splashImage);
splashImage.setBackgroundDrawable(getResources().getDrawable(R.drawable.splash));
//do Something
//splashImage 제거 , TextView을 fill_parent로
}
위 처럼 하고 싶은데 잘 안되네요.ㅠㅠ




간단하게는요... 꼼수지만.. layout을 두개를 두고요..
예를 들어 main2.xml이라면.. do something 이후에는 setContentView(R.layout.main2)를 해주시면 간단합니다.