Gabriel Angst Gabriel Angst - 2 months ago 19
Android Question

Long press in Webview - App Crash

When i long press text in the Webview (android), the app crashes. I also can't select text, because it crashes before the text is highlighted. Normally, the app would show the default Contextual Action Bar, but the app crashes.

In my Activity OnCreate, i used "setWebViewClient" and "LoadURL".

The webview is inside a RelativeLayout (main), below another RelativeLayout;

Here is the Log:


09-15 23:35:21.680 26033-26033/com.edireito.digimecum.dgpro
W/ActivityThread﹕ Application com.edireito.digimecum.dgpro is waiting
for the debugger on port 8100...

09-15 23:35:21.681 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ Sending WAIT chunk

09-15 23:35:21.771 26033-26043/com.edireito.digimecum.dgpro I/art﹕
Debugger is active

09-15 23:35:21.910 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ Debugger has connected

09-15 23:35:21.910 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ waiting for debugger to settle...

09-15 23:35:22.111 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ waiting for debugger to settle...

09-15 23:35:22.312 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ waiting for debugger to settle...

09-15 23:35:22.512 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ waiting for debugger to settle...

09-15 23:35:22.714 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ waiting for debugger to settle...

09-15 23:35:22.915 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ waiting for debugger to settle...

09-15 23:35:23.116 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ waiting for debugger to settle...

09-15 23:35:23.318 26033-26033/com.edireito.digimecum.dgpro
I/System.out﹕ debugger has settled (1383)

09-15 23:35:23.868 26033-26033/com.edireito.digimecum.dgpro
I/LibraryLoader﹕ Expected native library version number "",actual
native library version number ""

09-15 23:35:23.869 26033-26033/com.edireito.digimecum.dgpro
I/chromium﹕ [INFO:library_loader_hooks.cc(116)] Chromium logging
enabled: level = 0, default verbosity = 0

09-15 23:35:23.952 26033-26033/com.edireito.digimecum.dgpro
I/BrowserStartupController﹕ Initializing chromium process, renderers=0

09-15 23:35:23.958 26033-26033/com.edireito.digimecum.dgpro W/art﹕
Attempt to remove local SIRT entry from IRT, ignoring

09-15 23:35:23.991 26033-26033/com.edireito.digimecum.dgpro
E/AudioManagerAndroid﹕ BLUETOOTH permission is missing!

09-15 23:35:24.057 26033-26033/com.edireito.digimecum.dgpro
I/Adreno-EGL﹕ : EGL 1.4 QUALCOMM build:
AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018_msm8226_LNX.LA.3.5.1_RB1__release_AU
() OpenGL ES Shader Compiler Version: E031.24.00.08 Build Date:
03/07/14 Fri Local Branch: Remote Branch: quic/LNX.LA.3.5.1_RB1.1
Local Patches: NONE Reconstruct Branch:
AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018 + f2fd134 + NOTHING

09-15 23:35:24.104 26033-26228/com.edireito.digimecum.dgpro W/art﹕
Thread[16,tid=26228,Native,Thread*=0x48f0c758,peer=0x6526f030,"Thread-40584"]
attached without supplying a name

09-15 23:35:24.127 26033-26223/com.edireito.digimecum.dgpro W/art﹕
Thread[17,tid=26223,Native,Thread*=0x48ce1740,peer=0x6526ff90,"Thread-40585"]
attached without supplying a name

09-15 23:35:24.202 26033-26228/com.edireito.digimecum.dgpro
W/chromium﹕ [WARNING:proxy_service.cc(890)] PAC support disabled
because there is no system implementation

09-15 23:35:24.250 26033-26033/com.edireito.digimecum.dgpro W/art﹕
Attempt to remove local SIRT entry from IRT, ignoring

09-15 23:35:24.340 26033-26033/com.edireito.digimecum.dgpro W/art﹕
Attempt to remove local SIRT entry from IRT, ignoring

09-15 23:35:24.406 26033-26033/com.edireito.digimecum.dgpro W/art﹕
Attempt to remove local SIRT entry from IRT, ignoring

09-15 23:35:25.074 26033-26277/com.edireito.digimecum.dgpro W/art﹕
Thread[19,tid=26277,Native,Thread*=0x48ed9778,peer=0x652b6480,"Thread-40588"]
attached without supplying a name

09-15 23:35:25.223 26033-26033/com.edireito.digimecum.dgpro
D/AudioManagerAndroid﹕ ==> onReceive: s=0, m=0, n=h2w, sb=true

09-15 23:35:25.226 26033-26033/com.edireito.digimecum.dgpro
D/AudioManagerAndroid﹕ reportUpdate: state=0, devices=[Speakerphone,
Headset earpiece]

09-15 23:35:26.116 26033-26033/com.edireito.digimecum.dgpro
D/OpenGLRenderer﹕ Enabling debug mode 0

09-15 23:35:26.291 26033-26033/com.edireito.digimecum.dgpro
I/Choreographer﹕ Skipped 52 frames! The application may be doing too
much work on its main thread.

09-15 23:35:26.325 26033-26033/com.edireito.digimecum.dgpro
W/AwContents﹕ nativeOnDraw failed; clearing to background color.

09-15 23:35:27.031 26033-26033/com.edireito.digimecum.dgpro
W/AwContents﹕ nativeOnDraw failed; clearing to background color.

09-15 23:35:27.143 26033-26312/com.edireito.digimecum.dgpro W/art﹕
Thread[22,tid=26312,Native,Thread*=0x48f02c50,peer=0x652d35f8,"Thread-40591"]
attached without supplying a name

09-15 23:35:36.842 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ java.lang.NullPointerException: Attempt to invoke
virtual method 'android.content.Context
android.app.ActionBar.getThemedContext()' on a null object reference

09-15 23:35:36.852 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
android.support.v7.app.ActionBarImplICS.getThemedContext(ActionBarImplICS.java:302)

09-15 23:35:36.855 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
android.support.v7.app.ActionBarImplJB.getThemedContext(ActionBarImplJB.java:20)

09-15 23:35:36.859 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
android.support.v7.app.ActionBarActivityDelegate.getActionBarThemedContext(ActionBarActivityDelegate.java:210)

09-15 23:35:36.863 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
android.support.v7.app.ActionBarActivityDelegateICS.onActionModeStarted(ActionBarActivityDelegateICS.java:195)

09-15 23:35:36.868 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onActionModeStarted(ActionBarActivityDelegateICS.java:359)

09-15 23:35:36.872 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.internal.policy.impl.PhoneWindow$DecorView.startActionMode(PhoneWindow.java:2437)

09-15 23:35:36.876 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.internal.policy.impl.PhoneWindow$DecorView.startActionModeForChild(PhoneWindow.java:2362)

09-15 23:35:36.879 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
android.view.ViewGroup.startActionModeForChild(ViewGroup.java:665)

09-15 23:35:36.883 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
android.view.ViewGroup.startActionModeForChild(ViewGroup.java:665)

09-15 23:35:36.886 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
android.view.ViewGroup.startActionModeForChild(ViewGroup.java:665)

09-15 23:35:36.890 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at android.view.View.startActionMode(View.java:4554)

09-15 23:35:36.894 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.org.chromium.content.browser.ContentViewCore.showSelectActionBar(ContentViewCore.java:2341)

09-15 23:35:36.898 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.org.chromium.content.browser.ContentViewCore.access$2200(ContentViewCore.java:93)

09-15 23:35:36.902 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.org.chromium.content.browser.ContentViewCore$13.showHandles(ContentViewCore.java:2154)

09-15 23:35:36.906 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.org.chromium.content.browser.input.SelectionHandleController.onSelectionChanged(SelectionHandleController.java:168)

09-15 23:35:36.910 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.org.chromium.content.browser.ContentViewCore.onSelectionBoundsChanged(ContentViewCore.java:2620)

09-15 23:35:36.914 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native
Method)

09-15 23:35:36.918 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:24)

09-15 23:35:36.921 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:102)

09-15 23:35:36.925 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at android.os.Looper.loop(Looper.java:136)

09-15 23:35:36.928 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
android.app.ActivityThread.main(ActivityThread.java:5088)

09-15 23:35:36.931 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method)

09-15 23:35:36.935 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)

09-15 23:35:36.938 26033-26033/com.edireito.digimecum.dgpro
W/System.err﹕ at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)

09-15 23:35:37.040 26033-26033/com.edireito.digimecum.dgpro A/libc﹕
Fatal signal 6 (SIGABRT) at 0x000065b1 (code=-6), thread 26033
(digimecum.dgpro)

Answer

After analyzing the code, I found that the problem was in the beginning of the Java file. It started with

package com.edireito.dgpro.dgpro;
import...
public class MyActivity extends ActionBarActivity {

And when I changed "ActionBarActivity" to "Activity", it worked!

Thanks.

Comments