setContentView(R.layout.main2);
out= new ArrayList();
llay =(RelativeLayout) findViewById(R.id.displayPoll);
Relativ
The mistake here is in the choice of the subclass of LayoutParams.
The correct version of LayoutParams to instantiate depends on the parent of the view you're creating, not the type of the view itself.
Take a look at the logcat dump:
04-06 20:30:49.372: E/AndroidRuntime(1093): java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams
04-06 20:30:49.372: E/AndroidRuntime(1093): at android.widget.ScrollView.onMeasure(ScrollView.java:301)
Android is trying to typecast the instance of RelativeLayout.LayoutParams to, what I believe should be ScrollView.LayoutParams, because your RelativeLayout is inside of a ScrollView.
The fix should be to change the layout params type that you're using on the RelativeLayout to ScrollView.LayoutParams.