Embedded webview crashes on dialog

by siliconeagle » Wed, 19 Aug 2009 00:39:19 GMT


Sponsored Links
 I have an application that uses the webview to load webpages so user
can download media off them, but i get a crash when any sort of popup
tries to show (eg from a select box or save password dialog) - the
error is that for some reason the webview doesnt provide the new
dialog with the application context (even though it as passed to the
webview component when it was created).

Is there some method to use to supply the application context to
dialogs launched from the webview?

regards,
rob

--~--~---------~--~----~------------~-------~--~----~



Embedded webview crashes on dialog

by Balwinder Kaur (T-Mobile USA) » Wed, 19 Aug 2009 01:08:52 GMT


 Could you post your code and the stack trace, please ?
Balwinder Kaur
Open Source Development Center
T  Mobile stick together

The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Embedded webview crashes on dialog

by siliconeagle » Wed, 19 Aug 2009 18:59:31 GMT


 the stacktrace is :
W/dalvikvm( 1547): threadid=3: thread exiting with uncaught exception
(group=0x4000fe70)
E/AndroidRuntime( 1547): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime( 1547): android.view.WindowManager$BadTokenException:
Unable to add window -- token null is not for an application
E/AndroidRuntime( 1547):        at android.view.ViewRoot.setView
(ViewRoot.java:429)
E/AndroidRuntime( 1547):        at android.view.WindowManagerImpl.addView
(WindowManagerImpl.java:178)
E/AndroidRuntime( 1547):        at android.view.WindowManagerImpl.addView
(WindowManagerImpl.java:91)
E/AndroidRuntime( 1547):        at android.app.Dialog.show(Dialog.java:231)
E/AndroidRuntime( 1547):        at android.webkit.WebView$InvokeListBox.run
(WebView.java:4934)
E/AndroidRuntime( 1547):        at android.os.Handler.handleCallback
(Handler.java:587)
E/AndroidRuntime( 1547):        at android.os.Handler.dispatchMessage
(Handler.java:92)
E/AndroidRuntime( 1547):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1547):        at android.app.ActivityThread.main
(ActivityThread.java:3948)
E/AndroidRuntime( 1547):        at java.lang.reflect.Method.invokeNative
(Native Method)
E/AndroidRuntime( 1547):        at java.lang.reflect.Method.invoke
(Method.java:521)
E/AndroidRuntime( 1547):        at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime( 1547):        at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:540)
E/AndroidRuntime( 1547):        at dalvik.system.NativeStart.main(Native
Method)
I/Process (   58): Sending signal. PID: 1547 SIG: 3
I/dalvikvm( 1547): threadid=7: reacting to signal 3
I/dalvikvm( 1547): Wrote stack trace to '/data/anr/traces.txt'


the code is quite basic:
webView = new WebView(getApplicationContext());

is there another context i should use?



On Aug 18, 6:08pm, "Balwinder Kaur (T-Mobile USA)" <balwinder.k...@t-



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. ListActivity addHeader???

Hi,

I can add a header to my listview within another activity with:

list = (ListView) findViewById(R.layout.list_view);

View v = View.inflate(this, R.layout.skill_list_header, null);
        TextView t = (TextView) v.findViewById(R.id.skillHeader);
        list.addHeaderView(v);

this doesnt work however for ListActivity.  Can anyoneadd some insight
to this?  Sorry if this is obvious.

-- 

2. OOM loading images in Gallery

Hi,

We're  working on a application that loads photos using the gallery.
Most of the images in full size will be in the ~200 K range.

We've been profiling the application for memory usage and have made
several optimizations to try and make sure the application is not
holding unnecessary references.

However, the application continues to run out of memory when viewing
images via the Gallery widget.  It appears as if the Gallery does not
free the View objects after they're no longer in the viewable screen.

I'm wondering if this is a known problem and if there are any
suggestions to either work around it or other solutions.  Looking
through the source it looks like there's a RecycleBin object that
should be collecting references but heap dumps show references the
View objects.

Any help is appreciated.

Thanks,

Todd

-- 

3. java.io.IOException: Unable to open sync connection!

4. Unable to determine signal strength on Droid / Android 2.0 (onSignalStrengthsChanged deprecated)

5. drawText sub-pixel positioning

6. Choosing Dev Phone

7. com.google Authenticator for the new android.accounts.AccountManager API.