Use a Broadcast Receiver to Hook onto incomming SMS....Fire an Intent (with SMS Body as an Extra) to Trigger your Activity (your link will help with that)...in the onStart()
or onNewIntent()
you grab the Extra and update your UI...
Another Method would be to use a ContentObserver
for content://sms/
but that's advised against unless your sure the Messaging App will intercept the SMS.
Untested Code!
Intent intent = new Intent(context,YourActivity.class); //context from onRecieve(context,intentData)
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK); //required if ur app is not currently running.
intent.putExtra("SMSBODY",smsbody); //get smsbody from the getMessageBody() (from your link)
context.startActivity(intent);
In your Activity...In onStart()
or onNewIntent()
Intent intent = getIntent();
if(intent.getStringExtra("SMSBODY") != null)
{
String msg = intent.getStringExtra("SMSBODY");
//append msg to scroll view
}