Tuesday, 15 March 2011

android - Custom animation on Back Button - activity -



android - Custom animation on Back Button - activity -

as can see added transition every button menu , want add together fade in/out transition button. when press button activity close playing transition. how do that?

@override public boolean onoptionsitemselected(menuitem item) { // handle action bar item clicks here. action bar // automatically handle clicks on home/up button, long // specify parent activity in androidmanifest.xml. int id = item.getitemid(); if (id == r.id.action_settings) { toast.maketext(mainactivity.this, "settings selected", toast.length_short).show(); } if(id == r.id.action_settings) { intent openaboutactivityintent = new intent(this, third_activity.class); startactivity(openaboutactivityintent); overridependingtransition(r.anim.push_down_in,r.anim.push_down_out); } else if (id == r.id.exit){ finish(); overridependingtransition(r.anim.fade_in,r.anim.fade_out); homecoming true; }switch (item.getitemid()) { case r.id.about: toast.maketext(mainactivity.this, "about selected", toast.length_short).show(); } if(id == r.id.about) { intent openaboutactivityintent = new intent(this, second_activity.class); startactivity(openaboutactivityintent); overridependingtransition(r.anim.push_down_in,r.anim.push_down_out); } homecoming super.onoptionsitemselected(item); } @override public void onbackpressed() { log.d("cda", "onbackpressed called"); intent setintent = new intent(intent.action_main); setintent.addcategory(intent.category_home); setintent.setflags(intent.flag_activity_new_task); startactivity(setintent); }

}

@override public void onbackpressed() { //other code overridependingtransition(r.anim.push_down_in,r.anim.push_down_out); }

android animation transition

No comments:

Post a Comment