How to hide fragment with transaction fast as possible - Android? -
my current activity contains fragments. want open new activity on button click current activity. new activity transparent, , because of have hide fragment prev activity. no buttons prev activity should shown under new activity's buttons. i've done that. works. problem because there little pause between switching these 2 activities. obviusly hiding fragment of prev activity takes time. can make hide fragment faster? here code:
@override public void onarcadebuttonclicked() { fragmentmanager= getsupportfragmentmanager(); fragmenttransaction transaction = fragmentmanager.begintransaction(); transaction.hide(fragments[mainmenu]); transaction.commit(); intent i= new intent(this,arcademapactivity.class); startactivity(i); }
when remove first 4 lines , call new intent there no pause, new activity shown immediately, fragment old activity stays visible under new activity. idea how solve problem?
Comments
Post a Comment