c# - Intro activity is too slow to close -
i have intro activity contains view pager sliding intro page, picture above intro activity slides
i have 3 slides and, in third slide, have button "done" close activity , redirect app login page.
my problem when click in done, activity slow close. can me?
here code:
[activity (nohistory = true, mainlauncher = true)] public class introview : fragmentactivity { private viewpager _viewpager; private controleexibicaointro _controleexibicaointro; protected override void oncreate(bundle bundle) { base.oncreate(bundle); _controleexibicaointro = new controleexibicaointro(this); if (!_controleexibicaointro.deveexibirintro()) { fechaapresentacao(); } setcontentview(resource.layout.introview); _viewpager = findviewbyid<viewpager>(resource.id.viewpager); _viewpager.adapter = new introadapter(supportfragmentmanager); _viewpager.addonpagechangelistener(new introindicator(this.window)); _viewpager.setpagetransformer(false, new intropagetransformer()); actionbar.hide(); var btnnext = findviewbyid<button>(resource.id.btnnext); btnnext.click += btnnext_click; var btnskip = findviewbyid<button>(resource.id.btnskip); btnskip.click += btnskip_click; } private void btnskip_click(object sender, eventargs e) { fechaapresentacao(); } private void btnnext_click(object sender, system.eventargs e) { if (_viewpager.currentitem == (_viewpager.adapter.count - 1)) { fechaapresentacao(); } else { _viewpager.currentitem++; } } private void fechaapresentacao() { //_controleexibicaointro.cancelaexibicaointro(); var intent = new intent(this, typeof(settingsview)); overridependingtransition(0, 0); startactivity(intent); overridependingtransition(0, 0); finish(); } }
fechaapresentacao() method use close intro activity , redirect other activity.
try adding after call finish() or second option close activities other 1 starting.
private void fechaapresentacao(){ //_controleexibicaointro.cancelaexibicaointro(); var intent = new intent(this, typeof(settingsview)); startactivity(intent); finish(); overridependingtransition(0, 0); } private void fechaapresentacao(){ //_controleexibicaointro.cancelaexibicaointro(); var intent = new intent(this, typeof(settingsview)); intent.setflags(intent.flag_activity_clear_top); startactivity(intent); overridependingtransition(0, 0); }
Comments
Post a Comment