Code example for ScrollView

Methods: smoothScrollTo

0
		protected void onProgressUpdate(Integer... progress) {
			mProgressBar.setMax(getTimeout());
			mProgressBar.setProgress(progress[0]);
			if (mShowSerialInput && mActiveCmd.equals("hello"))
				mReception.setText(mReceptionBuffer);
			mScroller.smoothScrollTo(0, mReception.getBottom());
			 
			//Handle the UI progress 
			if (progress[0] == CMD_SUCCESS) {
				Toast.makeText(getApplicationContext(), "Success!", 1).show();
			} else if (progress[0] == CMD_TIMEOUT){
			    //do nothing 
				//Toast.makeText(getApplicationContext(), "Error: timeout running command.", 1).show(); 
			} else { 
				//just update the UI with some progress. 
			    if (mActiveCmd.equals("ping")) {
			        mReception.append(mPingResponse);
			    } 
			} 
		}