title: listview item having scattered alignment at runtime
body: <p>i have a listview item which is being populated at runtime and at the same time the alignment is being determined at runtime. its a chat interface. if message author is friend then the alignment should be left and if message author is me, then the alignment should be right.</p>
  
  <p>but on running it, its just as if the alignment is being done at random irrespective of the message author.
  what i have tried:</p>
  
  <pre><code>RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(
                  android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT,
                  android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);
  </code></pre>
  
  <p>i will gladly appreciate any help on this</p>