Hi,
U can use TextView for ur requirement . Here is a sample activity :
Using java Syntax Highlighting
public class TextViewDrawable extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
createTextWithDrawable();
}
private void createTextWithDrawable() {
// TODO Auto-generated method stub
TextView textView = (TextView) findViewById(R.id.text_with_drawable);
Drawable drawable = getResources().getDrawable(R.drawable.my_icon);
textView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
}
}
Parsed in 0.032 seconds, using
GeSHi 1.0.8.4
The method setCompoundDrawablesWithIntrinsicBounds() enables you to add images to TextView.
Regards
Satish