ScrollView Visibility

karikalan

New member
Hi,

I am using two ScrollViews and want to set visibility of one as GONE or INVISIBLE but when I do it by following java code the application terminates. If I do the same thing using Properties pan, in the eclipse, it just works. What is wrong?

-------------------------------------------------------------
Java code is:
-------------------------------------------------------------
public class Test extends Activity {
????
????List sv;
????
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

sv = new ArrayList();

sv.add((ScrollView)findViewById(R.id.scrollView1));
sv.add((ScrollView)findViewById(R.id.scrollView2));

sv.get(1).setVisibility(View.GONE);

setContentView(R.layout.main);
}
}

-------------------------------------------------------------
main.xml
-------------------------------------------------------------
 
Back
Top