How can i scroll my view

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How can i scroll my view

Postby yinglcs » Wed Nov 19, 2008 7:30 am

I have my simple HelloWorld application for android:

Code: Select all

public class HelloView extends View {

   public HelloView(Context context) {
      // TODO Auto-generated constructor stub

   protected void onDraw(Canvas canvas) {

      Paint p=new Paint();

      canvas.drawLine(10, 10, 40, 40, p);

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
          HelloView hv = new HelloView(this);


My question is how can I implement listen for key Event (say 'press 'j' and my view will scroll up by 10 pixels)?
Junior Developer
Junior Developer
Posts: 10
Joined: Fri Nov 14, 2008 6:19 am


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 10 guests