Java 如何设置壁纸的选择位置
我可以在imageview中显示来自url的图像,也可以将其设置为壁纸。。但我会创建一些类似nova launcher或google launcher的方法来设置壁纸。我的意思是全屏显示图像,你可以选择你想要的位置。我的意思是在下面的屏幕中: 这是我现在用来设置壁纸的代码:Java 如何设置壁纸的选择位置,java,android,crop,android-wallpaper,Java,Android,Crop,Android Wallpaper,我可以在imageview中显示来自url的图像,也可以将其设置为壁纸。。但我会创建一些类似nova launcher或google launcher的方法来设置壁纸。我的意思是全屏显示图像,你可以选择你想要的位置。我的意思是在下面的屏幕中: 这是我现在用来设置壁纸的代码: Button buttonSetWallpaper = (Button)findViewById(R.id.set); ImageView imagePreview = (ImageView)fin
Button buttonSetWallpaper = (Button)findViewById(R.id.set);
ImageView imagePreview = (ImageView)findViewById(R.id.preview);
imagePreview.setImageResource(R.drawable.five);
buttonSetWallpaper.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
WallpaperManager myWallpaperManager
= WallpaperManager.getInstance(getApplicationContext());
try {
myWallpaperManager.setResource(R.drawable.five);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}});
你得到许可了吗?当然,但这不是我的问题。。我可以设置墙纸,但我会创建一个视图,就像你在我发布的屏幕上看到的那样…@End.Game你找到解决方案了吗?