私はRomain Guyのblog postを読んで、ウィンドウの背景とパフォーマンスを設定して、それをエミュレートしようとしています。このような単純な解決策であり、私はなぜこの作業をすることができないのか分かりませんが、活動は指示された背景を拾うのを単に拒否します。Android:設定ウィンドウ起動したアクティビティの背景
私はListViewを持っています。これは、onListItemClickは新しいActivityを起動します。これは、完全にロードするのに3〜5秒かかります。ユーザーが待っている間、実際に準備が整う前にアクティビティを '参照'できるようにwindowBackgroundを描画したいと思います。ここに私のコードです:
立ち上げ活動のためのAndroidManifestスニペット:
<activity
android:name=".activity.EditorActivity"
android:screenOrientation="portrait"
android:windowBackground="@drawable/background_editor">
EditorActivityのためのXMLレイアウト:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/editor"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="Editor" />
</FrameLayout>
そして最後に、描画可能マニフェストに設定され、background_editor.xml :
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/editor_bg"
android:tileMode="repeat" />
editor_bgは、彼がdrawable fololdに位置する.pngファイルですr。
最終結果はEditorActivityを立ち上げますされ、そして私が見るすべては(私はXMLファイルが正しく読み込まれたことをテストすることを加えた白で表示される「エディタ」のテキストでデフォルト黒い背景である。
Iまた、FrameLayoutとTextViewの背景をandroid:background = "@ android:color/transparent"で透明に設定しようとしましたが、黒の背景にデフォルト設定されていたかもしれないと思っていました。数日、私は何か簡単なものを見逃していると確信しています...私がここで作っている間違いはありませんか?
http://とroid-developers.blogspot.com/2009/03/window-backgrounds-ui-speed.html –