Using Android Window Animations in a Fragment -


i have fragment i'm working has scrollable tabs in it. have button on 1 of fragments opens sub activity. want use translate animation android offers it's giving me errors.

button onclicklistener code:

button.setonclicklistener(new view.onclicklistener() {      @override     public void onclick(view arg0) {         intent intent = new intent(getactivity(), subactivity.class);          bundle translatebundle = activityoptions.makecustomanimation(getactivity(),         r.anim.slide_in_left, r.anim.slide_out_left).tobundle();          startactivity(intent, translatebundle);     } }); 

android studio giving me error:

startactivity (intent) in fragment cannot applied (intent, android.os.bundle)

i tried searching s.o. didn't find anything.

help appreciated!

edited answer try this!!

  intent intent = new intent(getactivity(), subactivity.class);      startactivity(intent)     getactivity().overridependingtransition(r.anim.slide_in_left, r.anim.slide_out_left) 

Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -