private void setupContent(LinearLayout contentPanel) {
    mScrollView = (ScrollView) mWindow.findViewById(R.id.scrollView);
    mScrollView.setFocusable(false);

    // Special case for users that only want to display a String
    mMessageView = (TextView) mWindow.findViewById(R.id.message);
    if (mMessageView == null) {
      return;
    }

    if (mMessage != null) {
      mMessageView.setText(mMessage);
    } else {
      mMessageView.setVisibility(View.GONE);
      mScrollView.removeView(mMessageView);

      if (mListView != null) {
        contentPanel.removeView(mWindow.findViewById(R.id.scrollView));
        contentPanel.addView(mListView, new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
        contentPanel.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, 0, 1.0f));
      } else {
        contentPanel.setVisibility(View.GONE);
      }
    }
  }
Exemple #2
0
 public void scrollDown() {
   final ScrollView sv = (ScrollView) findViewById(R.id.ScrollView01);
   sv.post(
       new Runnable() { // ugly but works!!!!
         public void run() {
           sv.fullScroll(ScrollView.FOCUS_DOWN);
         }
       });
   sv.setFocusable(false);
 }