2012-03-30 15 views

答えて

5

プログラムであなたが活動やサービスで、次のsetps必要があります。

ステップ1:AndroidManifest.xmlを

<uses -permission android:name="android.permission.SET_WALLPAPER" /> 

ステップ2:アクティビティやサービス

WallpaperManager wallpaperManager = WallpaperManager.getInstance(this); 
Drawable drawable = getResources().getDrawable(R.id.wallpaper); 
Bitmap wallpaper = ((BitmapDrawable) drawable).getBitmap(); 
wallpaperManager.setBitmap(wallpaper); 
中を

ステップ3

毎日壁紙を変更するためのAlarmManagerを使用

2

次のコードは、ホーム画面の壁紙を変更します。お客様の要件に応じて日付が変更されたときにサービスを実行します。

WallpaperManager wm = WallpaperManager.getInstance(this); wm.setBitmap(myBitmap);変更の壁紙用

関連する問題