I make an application with wallpaper, BUT there was a problem with the display of the picture, the picture appears only after I click on the "Set wallpaper" button

I would appreciate the help

enter image description here

my code

public class FullImageActivity extends Activity { public ImageView mImageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.full_image); } public void tempbitMap(View view){ // get intent data Intent i = getIntent(); // Selected image id int position = i.getExtras().getInt("id"); ImageAdapter imageAdapter = new ImageAdapter(this); mImageView = (ImageView) findViewById(R.id.full_image_view); mImageView.setImageBitmap(BitmapFactory.decodeResource(getResources(), imageAdapter.mThumbIds[position])); DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); int height = metrics.heightPixels; int width = metrics.widthPixels; Bitmap tempbitMap = (BitmapFactory.decodeResource(getResources(), imageAdapter.mThumbIds[position])); Bitmap bitmap = Bitmap.createScaledBitmap(tempbitMap, width, height, true); WallpaperManager wallpaperManager = WallpaperManager.getInstance(FullImageActivity.this); wallpaperManager.setWallpaperOffsetSteps(1, 1); wallpaperManager.suggestDesiredDimensions(width, height); try { wallpaperManager.setBitmap(bitmap); } catch (IOException e) { e.printStackTrace(); } } } 
  • You do not call your tempbitMap method in the onCreate method. By itself, he will not call - YuriySPb
  • @ YuriySPb I can’t call him ((( - V01ume
  • How so? I do not believe. This can not be - YuriySPb
  • I mean, what exactly I can not call him - V01ume
  • one
    Why don't you write this in question? Why do I need a few hours to get this information from you? How many hours will it take you to add this information to the question along with the error logs and an indication of the line of occurrence? - Yuriy SPb

0