Back to project page Android-Universal-Notifier.
The source code is released under:
Apache License
If you think the Android project Android-Universal-Notifier listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.mairos.universalnotifier.UI; /*from w w w . j a v a 2 s . c o m*/ import com.mairos.universalnotifier.R; import com.mairos.universalnotifier.model.NotificationService; import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.ScrollView; public class LogFragmentTab extends Fragment { private View m_rootView = null; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { m_rootView = inflater.inflate(R.layout.log_layout, container, false); EditText et = (EditText) m_rootView.findViewById(R.id.editText); et.setKeyListener(null); setLogText(NotificationService.getCurrentLog()); return m_rootView; } @Override public void onResume() { setLogText(NotificationService.getCurrentLog()); super.onResume(); } public void setLogText(String f_txt){ if (m_rootView != null){ final EditText et = (EditText) m_rootView.findViewById(R.id.editText); et.setText(f_txt); final ScrollView scroller = (ScrollView) m_rootView.findViewById(R.id.logScroll); scroller.post(new Runnable() { public void run() { scroller.smoothScrollTo(0, et.getBottom()); } }); } } }