Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 12    Views: 182

Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
Fourm StarFourm Star
06/03/14 05:00 AM (8 years ago)

Individual Screen Refresh Question?

Hi have a question to a problem I have when it comes to refreshing a screen in my app. I have been developing a music app, that has many songs. I have built the app using html5 and Jquery mobile. And then use individual page URLs which I insert into my app using a number of Custom URL plugins. What I want to know is, can I make my app screens that use the Custom URL plugin to hard refresh back to the URL inserted into that plugin, so no matter how many pages I navigate away from, if I select the button in my app to that custom URL, it will show the page URL inserted all the time. Not sure if I made sense, I hope I have. Can anyone help on what I need to do, not a coder, so you will need to explain to me in dummy terms. Thanks!
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
Fourm StarFourm StarFourm Star
like
06/03/14 06:55 AM (8 years ago)
Sorry @Dragon007, you lost me along the way, maybe a few screen grabs might make the scenario clearer? Long shot but might you want to re-instate a specific config.txt?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
06/03/14 08:16 AM (8 years ago)
is this a tab button by any chance
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
Fourm StarFourm Star
like
06/03/14 08:31 AM (8 years ago)
Yes it is a tab button. Trying to put this into words. I have a footer, with some tab buttons; all of these buttons are linked to a Custom URL plugin. For each Custom URL plugin I use, I have inserted a specific URL. Question, how do I ensure that every time that button is pressed by the end user that it will always show that page URL added, no matter if the user navigates away from that specific page within the Custom URL plugin screen.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
06/03/14 08:32 AM (8 years ago)
and when you click the tab at the bottom you want it to start at the beginning again.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
Fourm StarFourm Star
like
06/03/14 09:12 AM (8 years ago)
YES! YES! YES!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
06/03/14 09:34 AM (8 years ago)
Like when harry met sally
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
06/03/14 10:05 AM (8 years ago)
Add this [[self getNavigationController]popToRootViewControllerAnimated:NO]; under this in the app delegate around line 480 if(self.rootApp != nil){ if([self.rootApp.tabs count] > 0){
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
Fourm StarFourm Star
like
06/03/14 10:09 AM (8 years ago)
Hi Kittsy is this in my app delegate or the Custom URL plugin?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
06/03/14 10:13 AM (8 years ago)
in the appDelegate it will reset all tabs to the start. If you only want it to do that on one particular tab your a pain in the arse but in case you are pick the tab you want if([tabBarController selectedIndex] == 1){ [[self getNavigationController]popToRootViewControllerAnimated:NO]; } remember indexes normally start at 0; 1st tab = 0; 2nd tab = 1; etc
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
06/03/14 10:15 AM (8 years ago)
for multiple tabs if([tabBarController selectedIndex] == 0 || [tabBarController selectedIndex] == 4){ [[self getNavigationController]popToRootViewControllerAnimated:NO]; } tab 1 and 5
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
06/03/14 10:16 AM (8 years ago)
or every tab button other than 1 if([tabBarController selectedIndex] != 0){ [[self getNavigationController]popToRootViewControllerAnimated:NO]; }
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
Fourm StarFourm Star
like
06/03/14 10:30 AM (8 years ago)
Nice Kittsy! Its for every tab, so is it the first code you posted?
 

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.