行 wallpaperManager.setResource(R.drawable.wall1); 给出错误(R.drawable.wall1 上的红线)
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.wallpaper_set);
bSet = (Button) findViewById(R.id.bSetWall);
bSet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
WallpaperManager wallpaperManager = WallpaperManager.getInstance(WallpaperSet.this);
try {
wallpaperManager.setResource(R.drawable.wall1);
} catch (IOException e) {
e.printStackTrace();
}
}
});
}