Android: Possible to download imageview to phone or set an imageview as background?
I have an app that contains a picture gallery when one of the items in the gallery is pressed, the item clicked views as an imageview fullscreen. What I am then trying to do is allow the user to select whether to download the imagevie开发者_JAVA百科w to the phone or set it as a background...is this possible? How would I go about this? Thanks!
you can use WallpaperManager Service to the the system wallpaper.
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), resourcId);
WallpaperManager myWallpaperManager = WallpaperManager.getInstance(getApplicationContext());
try {
myWallpaperManager.setBitmap(bitmap);
} catch (IOException e) {
e.printStackTrace();
}
精彩评论