set flag for sent and receive message androidn
<p>I have 2 layouts. I need to set a flag and based on the flag value, i need to display my  message in either of the one layouts. If i send message i need to display in a.xml layout, If i receive the message i need to display in another layout b.xml. Sample code is given below. How can i achive it. </p>

<pre><code>    if (position == 0) {
                row = inflater.inflate(R.layout.list_row_layout_even,     parent,
                        false);
                TextView textLabel = (TextView)     row.findViewById(R.id.text);

                textLabel.setText(datav);

        } else {
            row = inflater.inflate(R.layout.list_row_layout_odd, parent,
                    false);
            TextView textLabel = (TextView) row.findViewById(R.id.text);

            textLabel.setText(datav);
           }
</code></pre>

<p>Thanks.</p>
