Android 获取当前壁纸的绝对路径?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11361119/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Get current wallpaper absolute path?
提问by Sekar
How do we get a current wallpaper absolute path
我们如何获得当前的壁纸 absolute path
回答by Tim Smart
On Android 4.2 the wallpaper is located at:
在 Android 4.2 上,壁纸位于:
/data/system/users/0/wallpaper
Replace the 0
with your user id (take a look in /data/system/users
).
将 替换为0
您的用户 ID(查看/data/system/users
)。
回答by Padma Kumar
Make sure you are looking in the phone's root directory to start, NOT on the SDcard. Once you get to the right subdirectory the wallpaper file will just be called "wallpaper" and until you copy it to the SDcard and rename it to "YourName.jpg" the picture viewers may not recognize it as an image file.
确保您正在寻找手机的根目录以启动,而不是在 SD 卡上。一旦进入正确的子目录,墙纸文件将被称为“墙纸”,直到您将其复制到 SD 卡并将其重命名为“YourName.jpg”,图片查看者可能无法将其识别为图像文件。
I tried both ES File Explorer and Root Explorer (download from Marketplace) to copy the file from the phone root area., i.e. phone ROOT/data/data/com.android.settings/files/wallpaper..
.it's the lowest level of the phone storage itself, similar to "computer" in windows.
我尝试了 ES File Explorer 和 Root Explorer(从 Marketplace 下载)从手机根区复制文件。即手机。ROOT/data/data/com.android.settings/files/wallpaper..
它是手机存储本身的最低级别,类似于 Windows 中的“计算机”。
Probably the File Explorer on your phone won't let you access the root (your phone shouldn't need ROOT privileges just to copy the file)
可能您手机上的文件资源管理器不允许您访问根目录(您的手机不需要 ROOT 权限即可复制文件)
回答by Orlymee
use wallpaperManager
and call getWallpaperInfo
. This will return you a wallpaperinfo
object which contains all the info about the wallpaper. Read more about the wallpapernfo here.
使用wallpaperManager
并调用getWallpaperInfo
. 这将返回一个wallpaperinfo
对象,其中包含有关壁纸的所有信息。在此处阅读有关壁纸信息的更多信息。
I would imagine that the current wallpaper will be stored in a private system folder.
我会想象当前的壁纸将存储在一个私人系统文件夹中。
回答by davisjp
On Android Oreo and using one of the provided wallpapers from the system, the wallpaper I wanted wasn't on the path mentioned by the accepted answer but I found the apk that had it on a system folder.
在 Android Oreo 上并使用系统提供的壁纸之一,我想要的壁纸不在接受的答案提到的路径上,但我在系统文件夹中找到了具有它的 apk。
I got it from the path: system/framework/framework-res.apk I had to open the apk and extract: /res/drawable-nodpi-v4/default_wallpaper.png.
我从路径中得到它:system/framework/framework-res.apk 我必须打开apk 并提取:/res/drawable-nodpi-v4/default_wallpaper.png。
回答by Eugene A Hammond
Android Oreo is not in the place from other comments
Android Oreo 不在其他评论中
Internal Storage/Android/data/com.android.systemui/files/backupwallpapers
内部存储/Android/data/com.android.systemui/files/backupwallpapers
I just had to find a wallpaper that I deleted from my downloads folder.
我只需要找到一张从下载文件夹中删除的墙纸。
回答by Spartacus
Download the apk file ...
下载apk文件...
go to this path...you can find it here
走这条路……你可以在这里找到
Download\com.amber.launcher.skin.samsung.galaxy_2018-08-24\res\drawable-nodpi-v4\bg_wallpaper.jpg
下载\com.amber.launcher.skin.samsung.galaxy_2018-08-24\res\drawable-nodpi-v4\bg_wallpaper.jpg
回答by omor
On Android 4.2 the wallpaper is located at:
在 Android 4.2 上,壁纸位于:
/data/system/users/0/wallpaper
Replace the 0 with your user id (take a look in /data/system/users).
将 0 替换为您的用户 ID(查看 /data/system/users)。
Make sure you are looking in the phone's root directory to start, NOT on the SDcard. Once you get to the right subdirectory the wallpaper file will just be called "wallpaper" and until you copy it to the SDcard and rename it to "YourName.jpg" the picture viewers may not recognize it as an image file.
确保您正在寻找手机的根目录以启动,而不是在 SD 卡上。一旦进入正确的子目录,墙纸文件将被称为“墙纸”,直到您将其复制到 SD 卡并将其重命名为“YourName.jpg”,图片查看者可能无法将其识别为图像文件。