I'm trying to change the source of my ImageButton, but for some reason I keep getting this error message: Cannot resolve method 'setImageResource' (android.graphics.drawable.Drawable).
Here's the code im trying to use:
<ImageButton
android:layout_width="32dp"
android:layout_height="32dp"
android:id="@+id/cuenta_1"
android:text="cuenta1"
android:background="@mipmap/ic_fondo"
android:layout_toLeftOf="@id/agregarCuenta"/>
And in the mainActivity:
Drawable logo = new BitmapDrawable(bitmap);
findViewById(R.id.cuenta_2).setImageResource(logo);
Any idea on how I can fix this?
I can see 2 errors
Change
to
For your reference: http://developer.android.com/reference/android/widget/ImageView.html#setImageResource%28int%29