After seeing many questions for this feature and attempting to follow the answers, I was left wondering if there was a clearer example to be had?
Edit: I was attempting
Try this:
Drawable appImg = getApplicationContext().getResources().getDrawable( R.drawable.ic_launcher );
appImg.setBounds( 0, 0, appImg.getIntrinsicHeight(), appImg.getIntrinsicWidth() );
Button btn_ok = (Button) findViewById(R.id.ok);
btn_ok.setCompoundDrawables( null, null, appImg, null );
Hope it helps you.
Thanks.