This would be called in your button's onClick()
handler
// get your button
Button docli_btn_apagar = (Button) findViewById(R.id.docli_btn_apagar );
// get the drawable
Drawable img = getContext().getResources().getDrawable( R.drawable.smiley );
// set the drawable left
docli_btn_apagar.setCompoundDrawablesWithIntrinsicBounds( img, null, null, null );
Or alternatively:
// You can skip the drawable object directly, by using ints/IDs
docli_btn_apagar.setCompoundDrawablesWithIntrinsicBounds(R.drawable.smiley, 0, 0, 0);