how to scroll in android???

Posted by antony on Stack Overflow See other posts from Stack Overflow or by antony
Published on 2010-06-18T04:28:22Z Indexed on 2010/06/18 4:33 UTC
Read the original article Hit count: 228

Filed under:

I create a program to add check boxes dynamically.But i cant scroll down.I add the code here ,Pls HELP......

package dyntodo.pack; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.CheckBox; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.Button; import android.widget.TextView; public class dynact extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView tv = (TextView)findViewById(R.id.textview); final EditText task = (EditText)findViewById(R.id.task); Button add = (Button)findViewById(R.id.add); add.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { addTask(task.getText().toString()); } }); } public void addTask(String task) { LinearLayout layout = (LinearLayout) findViewById(R.id.layout); final CheckBox chk = new CheckBox(this); //Creating checkbox objects….. chk.setText(task); layout.addView(chk); chk.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { chk.setVisibility(5); } }); } }

© Stack Overflow or respective owner

Related posts about android