Adding vertical scroll bar to an alert dialog
<p>I am making an alert dialog in an application.Because of more text present in the alert dialog,i want to put vertical scroll bar in the alert dialog.I have tried many options,But nothing is working.Please tell me how to solve this problem.This is the code :</p>

<pre><code>AlertDialog.Builder HelpOnButtonDialog ;
        HelpOnButtonDialog = new AlertDialog.Builder(this);
        TextView HelpOnButtonView = new TextView(this);
        HelpOnButtonView.setSingleLine(false);
        HelpOnButtonView.setTextColor(getResources().getColor(R.color.dark_green));
        HelpOnButtonView.setText("hello");  
        Button HelpOnButton = new Button(this);
        HelpOnButton.setHeight(20);
        HelpOnButton.setWidth(20);
        HelpOnButton.setText("Ok");
        HelpOnButton.setOnClickListener(HelpOnButtonClickListener);
        LinearLayout linearLayout = new LinearLayout(this);
        linearLayout.setLayoutParams( new  LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
                LinearLayout.LayoutParams.WRAP_CONTENT));
        linearLayout.setOrientation(1); 
        linearLayout.setBackgroundColor(getResources().getColor(R.color.black));
        linearLayout.addView(HelpOnButtonView);
        linearLayout.addView(HelpOnButton);

        ScrollView sv = new ScrollView(this);
        sv.pageScroll(0);
        sv.setBackgroundColor(0);
        sv.setScrollbarFadingEnabled(true);
        sv.setVerticalFadingEdgeEnabled(false);
        sv.addView(linearLayout);
        alertHelp = HelpOnButtonDialog.create();
        alertHelp.setView(sv);
        alertHelp.show();
</code></pre>
