开发者

Android: Possible to download imageview to phone or set an imageview as background?

开发者 https://www.devze.com 2023-01-15 04:58 出处:网络
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

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();
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消