2011-02-17 44 views
6

Xin chào Tôi có một ứng dụng mà tôi có thể chạm để cuộn qua một số màn hình như ứng dụng Android Homescreen.Làm cách nào để thay đổi hoạt ảnh mặc định khi thay đổi hoạt động?

Tôi hiện đã quản lý để thêm nút trên mỗi trang thay đổi từ này sang hoạt động mới, nhưng cuộn sang trái sang phải và tôi muốn cuộn xuống khi nút được nhấp nhưng tôi không thể tìm ra làm thế nào để làm nó.

(Đây có lẽ là một câu hỏi rất Noob -. Tiếc vì điều đó)

Đây là tập tin main.java tôi

public class main extends Activity { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 

     Button onebutton = (Button)findViewById(R.id.soundsone); 
     onebutton.setOnClickListener(new OnClickListener() { 

    public void onClick(View v) { 
     Intent i = new Intent(main.this, series1button.class); 
     startActivity(i); 

    } 
}); 


     Button twobutton = (Button)findViewById(R.id.soundstwo); 
     twobutton.setOnClickListener(new OnClickListener() { 

    public void onClick(View v) { 
     Intent i = new Intent(main.this, series2button.class); 
     startActivity(i); 

    } 
}); 
     Button threebutton = (Button)findViewById(R.id.soundsthree); 
     threebutton.setOnClickListener(new OnClickListener() { 

    public void onClick(View v) { 
     Intent i = new Intent(main.this, series3button.class); 
     startActivity(i); 

    } 
});  Button fourbutton = (Button)findViewById(R.id.soundsfour); 
     fourbutton.setOnClickListener(new OnClickListener() { 

    public void onClick(View v) { 
     Intent i = new Intent(main.this, series4button.class); 
     startActivity(i); 

    } 
});  Button fivebutton = (Button)findViewById(R.id.soundsfive); 
     fivebutton.setOnClickListener(new OnClickListener() { 

    public void onClick(View v) { 
     Intent i = new Intent(main.this, series5button.class); 
     startActivity(i); 

    } 
});  Button sixbutton = (Button)findViewById(R.id.soundssix); 
     sixbutton.setOnClickListener(new OnClickListener() { 

    public void onClick(View v) { 
     Intent i = new Intent(main.this, series6button.class); 
     startActivity(i); 

    } 
});  Button sevenbutton = (Button)findViewById(R.id.soundsseven); 
     sevenbutton.setOnClickListener(new OnClickListener() { 

    public void onClick(View v) { 
     Intent i = new Intent(main.this, series7button.class); 
     startActivity(i); 

    } 
});  Button eightbutton = (Button)findViewById(R.id.soundseight); 
     eightbutton.setOnClickListener(new OnClickListener() { 

    public void onClick(View v) { 
     Intent i = new Intent(main.this, series8button.class); 
     startActivity(i); 

    } 
}); 
    } 
} 

Trả lời

Các vấn đề liên quan