在我的 android 应用程序中,我有 4 个使用 xml 进行动画处理的图像按钮:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/home1"
android:state_focused="true"
android:state_pressed="true" />
<item android:drawable="@drawable/home1"
android:state_focused="false"
android:state_pressed="true" />
<item android:drawable="@drawable/home" android:state_focused="true" />
<item android:drawable="@drawable/home2"
android:state_focused="false"
android:state_pressed="false" />
</selector>
当我单击该按钮时,动画会运行,但由于新活动打开速度太快而无法正确显示。我希望看到完整的动画,我想我已经做了一个睡眠方法,但我不知道这到底是我的动作按钮:
btn_photos.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
// Launching News Feed Screen
Intent i = new Intent(getApplicationContext(), PhotosActivity.class);
startActivity(i);
}
});
请帮助:)