哈哈哈..這個答案有點晚了。 ;-)但是,我認爲它沒有被正確回答,所以這裏就是...我收集的是你想要啓動壁紙選擇器。有兩種方法可以做到這一點,取決於哪個Android版本,你會看到下面。您只能在版本16之後指定您的壁紙。否則,啓動選擇器並且用戶指定壁紙。
if (android.os.Build.VERSION.SDK_INT >= 16)
{
Intent intent = new Intent("android.service.wallpaper.CHANGE_LIVE_WALLPAPER");
intent.putExtra("android.service.wallpaper.extra.LIVE_WALLPAPER_COMPONENT", new ComponentName(getApplicationContext().getPackageName(), (new StringBuilder(String.valueOf(getApplicationContext().getPackageName()))).append(".LiveWallpaper").toString()));
try
{
startActivity(intent);
finish();
return;
}
catch (ActivityNotFoundException activitynotfoundexception)
{
activitynotfoundexception.printStackTrace();
}
return;
}
Intent intent1 = new Intent();
intent1.setAction("android.service.wallpaper.LIVE_WALLPAPER_CHOOSER");
try
{
startActivity(intent1);
}
catch (ActivityNotFoundException activitynotfoundexception1)
{
activitynotfoundexception1.printStackTrace();
Toast.makeText(getApplicationContext(), "Live Wallpapers not supported", 1).show();
}
finish();
不是真的......在android中有一個預覽動態壁紙的默認Activity。我想利用該Activity/Intent在設備上使用通用Live Wallpaper預覽活動。我假設你需要通過意圖(不管它叫什麼)一些關於你想要預覽的動態壁紙的額外信息。 – CatalystNZ 2011-04-05 21:45:39
更多類似這樣:http://stackoverflow.com/questions/2749791/creating-own-livewallpaperpreview? – 2011-04-06 05:30:56