SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
01/13/13 02:55 PM (11 years ago)

How can I eliminate the 'Progress Wheel of Death ?

I'm having an issue with almost anything that has to do with obtaining resources NOT on my device. When another page is supposed to load, every now and then I will get the 'progress wheel of death'. This is when the progress circle comes up, and never goes away. On iOS you can 'back' out of it. In Android, I have to kill my app to get out of it. I've seen a post on 'java redirection' but there wasn't enough info, and the site referenced is not working at the moment. Any suggestions?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/13/13 03:01 PM (11 years ago)
In my experience, this happens when refencing URL's in a html page. In my case I see it when a link tries to open in a new window. Is that your scenario? Opening in the same window ( _self) seems to work more reliably.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
01/13/13 03:02 PM (11 years ago)
If you are referring the wheel of death when loading loading a webpage etc in webview then it just involves commenting out a piece of code. Is this what you mean?
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
01/13/13 03:04 PM (11 years ago)
Hey everyone, I get this bad loading youtube in Android. LA
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
01/13/13 03:06 PM (11 years ago)
@LA have you managed to embed YouTube inside an android screen?
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
01/13/13 03:11 PM (11 years ago)
Hi @Mr stuck, No just a webview but can stream videos excellent. LA
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/13/13 03:16 PM (11 years ago)
Yes, it happens when I load either a customURL, a customHTML, etcetera. A Prime example is my 'social network' page, which is basically an HTML Page embedded in the app. However the links to 'Facebook' and 'Twitter' are on the internet. Sometimes clicking/tapping/triggering these links will cause the progress wheel of death. I've commented out the 'show progress(null, null)' on 'Most' of the direct calls for HTML/URL, but not for the 'cached' copies. Will I need to comment them all out? Am I commenting out the right thing? Cheers! -- Smug
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
01/13/13 03:22 PM (11 years ago)
@LA it would be great to find a way to stream using the embed code so only the video shows and not full YouTube page. I have to resort to launching native browser which is not ideal. @Smug. I'm stumped on that then bud. Hope you figure it out. Keep us posted
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/13/13 03:51 PM (11 years ago)
If you want to launch a youtube video, have you tried the launch native app plugin? Works for me.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/13/13 03:55 PM (11 years ago)
@Smugwimp, I don't believe the commenting out of code is a reliable fix for this. However, I do believe my first post here may solve your specific issue of calling links from a page. Or have I misunderstood?
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
01/13/13 04:00 PM (11 years ago)
@AlanMac launch native is not ideal as even with YouTube selected utterly asks which app you want to open with. I wish there was some way to embed YouTube videos in android html or other method but it won't work any other way except launch native.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/13/13 04:01 PM (11 years ago)
Hi guys, Great discussion. I had this error years ago, and found a simple fast fix thanks to David and a few others who directed me the right way. STEP 1: GO INTO YOUR CUSTOM URL PLUGIN CODE IN ECLIPSE /src/ (.java) STEP 2: AROUND LINE 129 OR 132 (SOMEWHERE THERE) FIND "showProgress" STEP 3: COMMENT OUT "showProgress(null, null);" LOOKS LIKE: //load url in built-in browser... // showProgress(null, null); return false; This will eliminate it and make everything work, progress wheel of life returns! Cheers, David https://buzztouchmods.com
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/13/13 05:02 PM (11 years ago)
So far I have done the following: comment out line 129/331 of BT_screen_customURL.java (progress wheel of death) comment out line 131/341/446/531 of BT_screen_customHTML.java (progress wheel of death) comment out line 131/342/447 of BT_screen_htmlDoc.java (progress wheel of death) comment out line 531 of BT_screen_quiz.java (progress wheel of death) comment out line 546 of WB_screen_menuimage.java (progress wheel of death) depending on the plugins you use, depending on the responses you get. I'm hoping this will cure what ails me. or my app... I gotta say, I hate commenting out the code, because the progress wheel serves a purpose... What I'd 'like' to see is a way to allow some kind of 'cancel' or user abort capability. I'll be snooping into this, hoping to find a way. If I do, I'll certainly share. Cheers! -- Smug
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/13/13 05:06 PM (11 years ago)
Yup Smug, the wheel is a loss, but I saw it as: I rather have the webpage load, without warnings about finishing then have it not load at all and completely becoming useless. Keep us updated, and best of luck! David https://buzztouchmods.com
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/13/13 05:16 PM (11 years ago)
@SmugWimp - so your app opens a webview ok, but links inside the webview show the wheel of death or just don't work? is that about right?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/13/13 05:49 PM (11 years ago)
raveyd - exactly.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/13/13 05:59 PM (11 years ago)
ok, try this.. Using customURL as an example, find this at around line 153: //do not try to load the URL.. return true; } } Under the last closing curly brace, add: @Override public void onLoadResource (WebView view, String url) { if (url.contains("facebook")||(url.contains("twitter")||(url.contains("something else")||(url.contains("some other site") ) ) ) ) ) ) { if(view.getHitTestResult().getType() > 0){ view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); view.stopLoading(); } } } I've added facebook and twitter as examples. To add or remove sites just follow the pattern and make sure there are the right amount of closing brackets! It might not be quite what you want but it should stop the wheel of death and load the destination url.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/13/13 05:59 PM (11 years ago)
ughhhhh, sorry for the lack of code formatting!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/13/13 06:52 PM (11 years ago)
Not a problem re formatting, lol! Funny you should use those as examples, they are the EXACT sites I'm linking to, and having issues with (having already changed 'https' to 'http' to no avail). I did plug in the code, but alas it doesn't change things. I'm trying them out in the "customHTML" because that is my main area of concern. What I've done is created a static HTML page. It's embedded in the app. But 'on' the HTML page are two links; one to Twitter, one to Facebook. Simple links; nothing fancy. on either, I get the 'progress wheel of death' and can't get out without 'killing' the app process. I'm close... I can feel it. But I'm not quite there yet. Film at 11. Cheers! -- Smug
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/13/13 07:09 PM (11 years ago)
Didn't work at all? It should open the urls in the device browser. Not ideal, but works. (usually!). What about using a customURL? Put the html file in the assets folder of the project and make the url in your control panel - file:///android_asset/webpagename.html - 99%(ish) certain the code above will work then!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/13/13 07:11 PM (11 years ago)
You know, I was wondering what the local filename scheme in Android was. I'll try that too! Cheers! -- Smug
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/13/13 07:14 PM (11 years ago)
Gotta go, good luck!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/13/13 07:53 PM (11 years ago)
I think I might have it. Not as 'intuitive' as I'd like, but you can get out of it. In the file "BT_progressSpinner.java" on line 51 you'll have a couple of lines of code: +++++++++ public static BT_progressSpinner show(Context context, CharSequence title, CharSequence message, boolean indeterminate){ return show(context, title, message, indeterminate, false, null); } +++++++++ Change the return line's "5th" value to TRUE +++++++++ public static BT_progressSpinner show(Context context, CharSequence title, CharSequence message, boolean indeterminate){ return show(context, title, message, indeterminate, true, null); } +++++++++ (shown in this image: https://dl.dropbox.com/u/115208762/WheelOfDeathFix.png) I'm still not '100%' sure, but I 'think' we're setting the cancellation capability to 'true'. What happens as an end result is fairly close to my desires: While loading, the progress wheel comes up. The difference is that when the progress wheel takes 'too' long, I can 'back' out of it using my back key on the droid. And because it's at the 'Root' of the issue, it requires no further alteration of any other files, and effects ALL subsequent calls from any page, not just webview. Let me know if anyone discovers a better way, or a flaw in mine. Cheers! -- Smug
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
03/20/13 06:35 AM (11 years ago)
Hi @Smugwimp, I just fixed an issue by following this thread and just thought I'd report my findings. To set the scene, I have a html doc plugin, with a link to an RSS feed on rssinclude.com. If I click on a link in the rssinclude page, I get the spinner of death problem. I made the change you suggested to BT_progressSpinner.java, which indeed allowed me to back out of the page I had a problem with, but it was not enough on its own. To actually get the content, I needed to comment out the showProgress lines in BT_screen_htmlDoc.java to before I could actually load the page the rss links to (in this case on twitter). I have a suspicion that the whole problem is to do with the number of url redirects going on, which is a problem on Android but not ios. I am better at testing than fixing!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/20/13 01:21 PM (11 years ago)
Always good to have more info! Thanks Alan! Cheers! -- Smug
 

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.