I make apps with wallpapers for my phone, but I can't make the "Set Wallpaper" button under the picture.

full_image.xml :

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/full_image_view" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </LinearLayout> 

Made setawall() method:

 public class FullImageActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.full_image); Intent i = getIntent(); 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])); } public void setaswall(View view) { WallpaperManager wm = WallpaperManager.getInstance(this); try { final Bitmap bitmap = ((BitmapDrawable) mImageView.getDrawable()).getBitmap(); if (bitmap != null) { wm.setBitmap(bitmap); } } catch (final IOException e) { e.printStackTrace(); } } 

how to fasten it to the button I have no idea

  • I don’t know how to implement it at all - V01ume
  • Corrected the text! - V01ume
  • How to handle pressing a button - pavlofff
  • Well, I know how to use Google like - V01ume
  • Well, what's the problem, what have already been done and why it does not work - pavlofff

0