0

I have to place textview on Imageview and have to set as Wallpaper.

I am able to set the wallpaper with Textview place on Imageview but the Wallpaper is not stretching to phone screen. Below is the code I have used. Please provide a solution.

WallpaperManager wallpaperManager =WallpaperManager.getInstance(getBaseContext()); 
DisplayMetrics metrics = new DisplayMetrics(); 
getWindowManager().getDefaultDisplay().getMetrics(metrics); 
int height = metrics.heightPixels; 
int width = metrics.widthPixels;
Bitmap wallpaper = Bitmap.createScaledBitmap(bitmap1,width,height, true);
Canvas canvas = new Canvas(wallpaper);
imageView.draw(canvas);
textView.draw(canvas);
try {
wallpaperManager.setBitmap(wallpaper);
wallpaperManager.suggestDesiredDimensions(width,height);
}
catch (IOException e) {
Toast.makeText(FullImageActivity.this,
"Error setting wallpaper", Toast.LENGTH_SHORT)
.show();
}

The above code is setting the wallpaper but not covering the navigation menu bar located at the bottom. Please help me in this.

1 Answers1

0

You cannot cover the navigation bar (except in your apps in certain modes). However on nexus 5 the system navigation bar is translucent

andrei
  • 2,934
  • 2
  • 23
  • 36
  • Thanks for the Reply. I am able to cover the naivgation bar as well if I remove below line of code. But the problem is the wallpaper I set is getting zoomed and not fitting to the screen. wallpaperManager.suggestDesiredDimensions(width,height); – user2586986 Nov 26 '13 at 04:41
  • If it is not possible with the code I am using, can you please tell me any other way through which I can set wallpaper to the size of phone screen. Please help me in this. – user2586986 Nov 26 '13 at 16:34
  • @user2586986 I told you, it is not possible to cover with a wallpaper the navigation bar (back, home, running apps buttons at the bottom with a black background) – andrei Nov 26 '13 at 17:49
  • Sorry to bother you again. I was not talking about those buttons, I was talking about the favourites icons placed just above those buttons like menu icon, contacts icons, call icons etc. My code not able to cover the wallpaper under these icons. – user2586986 Nov 27 '13 at 05:05