@Override
  public void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);
    final ScrollView scrollView = (ScrollView) findViewById(R.id.license_activity_scrollview);
    final int firstVisibleChar = savedInstanceState.getInt(STATE_SCROLL_POS);
    scrollView.post(
        new Runnable() {
          @Override
          public void run() {
            TextView textView = (TextView) findViewById(R.id.license_activity_textview);
            int firstVisibleLine = textView.getLayout().getLineForOffset(firstVisibleChar);
            int offset = textView.getLayout().getLineTop(firstVisibleLine);
            scrollView.scrollTo(0, offset);
          }
        });
  }
Simple Activity that renders locally stored open source legal info in a text view.
java/com/google/android/apps/authenticator/license/LicenseActivity.java