The skeleton of my code is written out below. I need a way to have an activity that can display a view that is larger than the screen. I need to be able to add views dynamically, so I cant create a static list in the xml manifest file. I need to add views sequentially (ReportView2 in this example) to the main layout. I implemented this by putting the views in a linearLayout and then placing the layout in the ScrollView. Since I also need to place buttons in the layout on an absolute basis, I placed the scrollview into an absoluteLayout.
When I run my code, the views' onDraw method is not called (the method that actually draws the views usually called by setContentView()), and therefore I get a blank screen. Any ideas?
Thanks in advance
[syntax="java"]public class RepMed2 extends Activity{
ScrollView reportView;
AbsoluteLayout myLayout;
LinearLayout mLL;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//initiating views
reportView = getView();
myLayout = new AbsoluteLayout(this);
myLayout.setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 0 , 0));
myLayout.addView(reportView);
setContentView(myLayout);
reportView.invalidate();
myLayout.bringToFront();
}
private ScrollView getView(){
//setup new linearlayout
mLL = new LinearLayout(this);
mLL.setOrientation(LinearLayout.VERTICAL);
mLL.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
mLL.setVerticalScrollBarEnabled(true);
mLL.setBackgroundColor(0xffffcc99);
addViews();
ScrollView sv = new ScrollView(this);
sv.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
sv.addView(mLL, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
return sv;
}
private void addViews() {
ReportView2 rep = new ReportView2(this, med, timeOfInterval);
mLL.addView(rep);
}
}


