I am making a project in which wallpaper will be changed after every 10 seconds I am able to set Bitmap array to the Service class using this code
resized[i]= Bitmap.createScaledBitmap(yourbitmap, 480,800, true);
Intent i = new Intent(MainActivity.this,WallService.class);
i.putExtra("Imagess", resized);
startService(i);
In the service class i am using this code:
String[] Bits = intent.getStringArrayExtra("Imagess");
for(int i =0; i<Bits.length;i++){
getApplicationContext().setWallpaper(Bits[i]);
Thread.sleep(10000);
}
It is giving error in this line The method setWallpaper(Bitmap) in the type Context is not applicable for the arguments (String). So what must I do so that i can set wallpapers by conerting String[] to Bitmap[]
Update 1:
Bitmap[] Bits = (Bitmap[]) intent.getExtras().getParcelableArray("Imagess");
for(int i =0; i<Bits.length;i++){
try {
getApplicationContext().setWallpaper(Bits[i]);
Thread.sleep(10000);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}