Discussion Forums  >  Uncategorized

Replies: 6    Views: 235

naguchennai
Android Fan
Profile
Posts: 28
Reg: Jun 26, 2011
india chennai
280
01/26/12 12:36 PM (14 years ago)

Back Button problem in weburl

Ok.. Back Buttons work good... If i use weburl like-login- then to to my account,and profile.. here if i am click back buttom it directly going to application home page menu layout... it must go to profile i am right? any help?
 
KevinPerry
Android Fan
Profile
Posts: 199
Reg: Jan 10, 2012
Wisconsin, USA
12,890
like
01/26/12 01:14 PM (14 years ago)
I can not answer for sure, but will give it a try. Just me thinking it through. If you use a webURL page, you are on that page (or past it) the application does not know what page you are on, on the web site, it only knows what internal page in the app (the webURL page) you are on and what the last app page was. My thinking would be that it is acting correctly. The back button is taking you to the last page that you were at in the app (not on the webpage you were veiwing). I could be wrong, would not be the first time ;-) Added afterwards. One option that I could think of, not sure how it would fit into your app but ... The possibility to open the native browser in the device is there. You could always have it open that, then the back buttons are internal to the browser and will go back just one web page at a time. Now in a lot of cases, this will not work due to breaking out of the app at that time. Just a thought
 
naguchennai
Android Fan
Profile
Posts: 28
Reg: Jun 26, 2011
india chennai
280
like
01/26/12 01:28 PM (14 years ago)
Yes.. Back button Function working good.. but not good for weburl.. I think i need change the code...How can i add my own back button function in web url?
 
KevinPerry
Android Fan
Profile
Posts: 199
Reg: Jan 10, 2012
Wisconsin, USA
12,890
like
01/26/12 01:32 PM (14 years ago)
I can not answer that. I am not a REAL programmer. Just my thinking would say that adding a back button inside the webpage that is being viewed, will not help much. There can be (or is) a back button in the title bar of the webURL app page. But that does what you do not want it to do, to go back to the last app page. You want it to go to the last web page inside the single app page. Not sure if you can or not, doubt it though, but others may prove me wrong. To me a comparison would be ... I have all these soup bowls (app pages), one of these soup bowls is to hold water (web page). I can add the water one level (page) at a time, but I can not take out (go back) just one level of the water, it all has to go. So ... I get to see what is put in, but can not remove what is already in there, unless it is emptied. If I add water to the soup bowl, without knowing where every oxygen&hydrogen atom is located, I can not remove just part of the water and make it act like the last level of water did. Sort of like watching TV. you get all the channels (app pages) that will do what they are supposed to do. You watch one channel and want to replay/go back to part of it. Unless you have another item that controls that function, it is not possible. Without having the browser functions, it is most likely not possible to do what you ask. Again, I could be wrong.
 
naguchennai
Android Fan
Profile
Posts: 28
Reg: Jun 26, 2011
india chennai
280
like
01/29/12 04:27 PM (14 years ago)
Any Way to add separate back buttons in weburl?
 
ScifiMan
Code is Art
Profile
Posts: 9
Reg: Dec 16, 2011
Auckland, NZ
90
like
02/17/12 05:59 PM (13 years ago)
Hi naguchennai I encountered the same issue using btv1.5.. Could'nt find any solution(s) in the forums either. Have tried this as a work around.. unchecking this code in btv1.5 gets the 'device' back button mimic the browser back button and goes back one external url page at a time. Depending on whether you are using custom html or custom url change the following in either one or both as necessary; (1) BT_screen_webView.java – handleBackButton() --- reactivate the deactivated code before this (around line 417 -420) (2) BT_screen_customHtml.java – handleBackButton()--- reactivate the deactivated code before this (around line 417 -420) The code after uncommenting should look like this ________________________________________________________________________ public boolean onKeyDown(int keyCode, KeyEvent event){ if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.canGoBack()){ webView.goBack(); return true; } //not the back-key.. return super.onKeyDown(keyCode, event); } _______________________________________________________ Hope this helps mate!
 
ganesha
I hate code!
Profile
Posts: 1
Reg: May 31, 2012
miami
10
like
06/01/12 08:31 AM (13 years ago)
public boolean onKeyDown(int keyCode, KeyEvent event){ if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.canGoBack()){ webView.goBack(); return true; } //not the back-key.. return super.onKeyDown(keyCode, event); } i just tray.... but still get error "KeyEvent cannot be resolved to type and variable" could you please tell me how it work? thanks before :)
 

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.