How to change ImageView source in android How to change ImageView source in android xml xml

How to change ImageView source in android


whoamiwith.setImageResource(R.drawable.loginbtn);


 ImageView whoamiwith = (ImageView)findViewById(R.id.whoamiwith)   Drawable new_image= getResources().getDrawable(R.drawable.loginbtn);       whoamiwith.setBackgroundDrawable(new_image);


Just try

ImageView whoamiwith = (ImageView)findViewById(R.id.whoamiwith)  whoamiwith.setImageResource(R.id.new_image);