how to set bubble images to background of textview in android programatically?
<pre><code>msgList = (ListView)findViewById(R.id.msgList);
receivedMessages = new ArrayAdapter&lt;String&gt;(this, R.layout.message);

msgList.setAdapter(receivedMessages);
msg     = (EditText)findViewById(R.id.msg);

msg.setOnKeyListener(new OnKeyListener() {
    public boolean onKey(View v, int keyCode, KeyEvent event) 
    {           
        if ((event.getAction() == KeyEvent.ACTION_UP) &amp;&amp;
                      (keyCode == KeyEvent.KEYCODE_ENTER)) {
            postMessage();
            return true;
        }
        return false;
    }
});

private void postMessage()
{       
    String theNewMessage = msg.getText().toString();
    try{
        myThread.sendMessage(theNewMessage);
    }catch(Exception e){
        Log.e(TAG,"Cannot send message"+e.getMessage());
    }
    receivedMessages.add(theNewMessage+":Me");

    msg.setText("");
    //receivedMessages.getContext().getString(sendmsg);
}
</code></pre>

<p>I want to set background bubble image to string result means theNewmessage. Where I get the my result.bubble image get automatic size according to its character size length.</p>
