こんにちは私はAndroid Homescreenアプリのようないくつかの画面をスクロールするために触れることができるアプリケーションを持っています。アクティビティの変更時にデフォルトのアニメーションを変更するにはどうすればよいですか?
私は今、これを新しいアクティビティに変更するボタンを各ページに追加することができましたが、スクロールは左から右になり、ボタンをクリックすると下にスクロールしますが、わかりませんどうやってするの。
は(これはおそらく非常にnoobの質問です - 。そのために残念)
ここに私のmain.javaファイルには、あなたがoverridePendingTransition
にを使用する、apidemosのディレクトリにexampleを参照してもよい
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);
}
});
}
}