Quick tips for ListView: build a layout like a chat with TranscriptMode and StackFromBottom

Our purpose is to create a very simple layout with a ListView that looks like a chat. Something like this: It is very easy. Let's take a common ListView in a RelativeLayout. Let's populate a simple Adapter, and run it. public class MainActivity extends ListActivity { private ViewHolderAdapter mAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mAdapter = ListHelper.buildViewHolderAdapter(this, R.layout.list_item); setListAdapter(mAdapter); } } This is still not what we wuold like to achieve. Now we'll add an xml attribute to ListView: android:stackFromBottom="true" . In this way the ListView stacks its content from the bottom. We'll optimize the scroll with another xml attribute : android:transcriptMode="alwaysScroll" In this way the list will automatic...