I'm attempting to display loading progress for a WebView in an Android Activity. When I attempt to display the window's progress bar with:
requestWindowFeature( Window.FEATURE_PROGRESS );
as per http://developer.android.com/guide/appendix/faq/commontasks.html#progressbar but at this point I get a debugging error.
When the error occurs I see a new tab "ActivityThread.performLaunchActivity" in Eclipse which has a message "Source not found." and a button "Edit Source Lookup Path...".
When I remove the offending line I don't get this error.
What could be causing this problem? Do I need to set a permission in the AndroidManifest.xml file or is there something else I'm missing?
Have you tried making your requestWindowFeature()
call before you call setContentView()
?
This is necessary according to this post.
The docs for Window.requestFeature():
Enable extended screen features. This must be called before setContentView(). May be called as many times as desired as long as it is before setContentView().
Use:
public class MainActivity extends Activity
instead of:
public class MainActivity extends ActionBarActivity
Make sure you are calling requestWindowFeature( Window.FEATURE_PROGRESS );
before you call setContentView()
in onCreate()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With