the line "private void setWallpaper(Bitmap bitmap)" is giving me a Cannot reduce the visibility of the inherited method from ContextWrapper error and I don't know how to fix it. so can you please help me, thanks.
here is my code:
Thread t = new Thread(new Runnable(){
public void run(){
final Bitmap bmWallpaper = loadImage(toPhone2);
runOnUiThread(new Runnable(){
public void run() {
setWallpaper(bmWallpaper);
}
});}}
);
t.start();
break;
}
}
private Bitmap loadImage(int id) {
InputStream WP = getResources().openRawResource(id);
Bitmap wallpaper = BitmapFactory.decodeStream(WP);
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int height = metrics.heightPixels;
int width = metrics.widthPixels;
Bitmap tempbitMap = BitmapFactory.decodeResource(getResources(), toPhone2);
Bitmap bitmap = Bitmap.createScaledBitmap(tempbitMap,width,height, true);
return bitmap;
}
private void setWallpaper(Bitmap bitmap) {
try{
wallpaperManager.setBitmap(bitmap);
getApplicationContext().setWallpaper(wallpaper);
}catch(IOException e){
e.printStackTrace();
}
}