Je veux mettre fond d'écran par application pour tous les appareils mais le problème est que mon travail d'approche suivante pour Moto, sony, Micromax mais pas ajuster correctement pour tout appareil Samsung comme Samsung S3 , samsung duos, Tab etc, dans ces appareils fond d'écran est beaucoup zoom voir dans les captures d'écran.Wallpaper pas correctement en forme sur les appareils Samsung
veuillez me guider pour résoudre ce problème.
private void setMyWallpaper() {
WallpaperManager myWallpaperManager = WallpaperManager
.getInstance(getApplicationContext());
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
// get the height and width of screen
int height = metrics.heightPixels;
int width = metrics.widthPixels;
Drawable drawable = null;
if (who.equals("color"))
drawable = getResources().getDrawable(colorWallpaper[i]);
else
drawable = getResources().getDrawable(grayWallpaper[i]);
Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
Bitmap wallpaper = Bitmap.createScaledBitmap(bitmap, width, height,true);
myWallpaperManager.suggestDesiredDimensions(width, height);
try {
myWallpaperManager.setBitmap(wallpaper);
Log.i("Wall", "Wallpaper set successfully ");
} catch (IOException e) {
e.printStackTrace();
}
}
toile Micromax capture d'écran: -
http://stackoverflow.com/questions/22759358/wallpaper-not-properly-fit-on-device-screen –
@IntelliJAmiya j'ai essayé ce code déjà mais encore un problème ...... une chose pouvez-vous m'expliquer pourquoi là ils utilisent le récepteur .... –
@ Garg je pense qu'il y a un problème de taille de l'image avec vous.Veuillez vérifier la largeur et la hauteur de l'image et l'écran – PankajSharma