Code example for ScrollView

Methods: post

0
		if (getActivity() != null) {
			String message = b.getString(LOG_MESSAGE);
			message.replaceAll("\\n", "");
			log = log + message + "\n";
			myTV.setText(log);
			mySV.post(new ScrollToBottom());
		} 
	} 
 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View v = inflater.inflate(R.layout.log_fragment, null);
		myTV = (TextView) v.findViewById(R.id.logText);
		myTV.setText(log);
		mySV = (ScrollView) v.findViewById(R.id.SCROLLER);
		logToggle = (ToggleButton) v.findViewById(R.id.logToggle);
		sendLog = (ImageButton) v.findViewById(R.id.sendLog);
		logToggle.setOnClickListener(onClick);
		logToggle.setChecked(PrefUtil.readBoolean(getActivity(),
				Pref.LOG_KEY.key()));