Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 10    Views: 63

Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
08/24/14 07:41 AM (10 years ago)

'Reboot' app

I have a instruction app that navigates through a set of screens for the user. When they get to the end, I want them to be able to start again from the 'home screen' I have this working by having a button on the last screen that directs them to home screen, however, the navigation bar allows them back through all the screens. Is there anyway to 'reload' the app so they hope back to the beginning so I can see the refresh button? This app may be used 20-30 times in a row so one user could navigate back through screen after screen from when previous users have ran the app. Hope this makes sense
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
08/24/14 07:51 AM (10 years ago)
I see what you mean. What plugin are you using for your screens?
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
08/24/14 07:52 AM (10 years ago)
I mixture of about 7/8 but my home screen is a carousel
 
Ed Goodall
Fusion Technology
Profile
Posts: 422
Reg: Oct 01, 2011
Wiltshire, UK
12,320
like
08/24/14 07:53 AM (10 years ago)
Ah ok. I'm only on the mobile at the moment but can try and take a look this evening?
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
08/24/14 07:54 AM (10 years ago)
Any help is appreciated
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/24/14 08:54 AM (10 years ago)
Shouldn't 'refreshAppData' do the trick? Same command in either Android or iOS. Cheers! -- Smug
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
08/24/14 11:55 PM (10 years ago)
Good idea smug. How do you call that from another screen? [self refreshAppData]; ?? im not a good coder. I'm thinking of having my 'Home' button on the final screen call the blank plugin, and then adding this code to that plugin to refresh the data. this plugin already imports the appldelegate.h where the refresh app code is so i added [self refreshAppData]; but got 'No visible @interface for BT-screen_blank declares the sector 'refreshAppData' thanks
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/25/14 05:28 AM (10 years ago)
[self refreshAppData]; is absolute overkill. And will provide a poor user experience in the long run, me personally and app refresh can take a couple of seconds. If you want to return to the home screen in iOS you uses [self.navigationController popToRootViewControllerAnimated:YES]; in android you use this ((BT_activity_host)getActivity()).showAppHomeScreen(); Both of these methods go straight to the home screen, no messing around no reloading data, no removing cached images. I wouldn't add this to a blank plugin, I would intercept the tap and use an if else statement. if([loadScreenNickname isEqualToString:@"home"]){ [self.navigationController popToRootViewControllerAnimated:YES]; return; }
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
08/25/14 07:56 AM (10 years ago)
Perfect, thanks Andy. Too be picky, is there anyway to add a 'fade' transition to it please? it working but looks messy when it jumps to that screen cheers
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/25/14 08:09 AM (10 years ago)
CATransition* transition = [CATransition animation]; transition.duration = 1.0; transition.type = kCATransitionFade; [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; [self.navigationController popToRootViewControllerAnimated:NO];
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
08/25/14 08:16 AM (10 years ago)
perfect! thanks Andy
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.