Android – strange behavior of using EditText inside Tags
I have a view that contains another view with an "include" component (see http://android-developers.blogspot.com/2009/02/android-layout-tricks-2-reusing-layouts.html )The included view has some EditText
There are some problems with these edittexts:
>I have to click them twice to display the keyboard > If I long press an application in EditText to freeze and crash (only on my phone – Samsung Galaxy S, not on the simulator)
If EditText is not in < include >, this will not happen. Label... Do you have any ideas about this problem?
Hello, Christopher
resolvent:
I have the same question about the crash of long press EditText or textview on Samsung devices on Android 4.0
Crash login here
java.lang.ArithmeticException: divide by zero
at android.widget.TextView$SelectionActionModeCallback.onCreateActionMode(TextView.java:10647)
at com.android.internal.policy.impl.PhoneWindow$DecorView.startActionMode(PhoneWindow.java:2382)
at com.android.internal.policy.impl.PhoneWindow$DecorView.startActionModeForChild(PhoneWindow.java:2322)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:571)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:571)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:571)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:571)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:571)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:571)
at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:571)
at android.view.View.startActionMode(View.java:3687)
at android.widget.TextView.startSelectionActionMode(TextView.java:10451)
at android.widget.TextView.performLongClick(TextView.java:9570)
at android.view.View$CheckForLongPress.run(View.java:14241)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4507)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
@Dumpstate > dumpstate -k -t -n -z -d -o /data/log/dumpstate_app_error
This is because when you press and hold the text, the Samsung system will select the text to be highlighted and use oncreateactionmode() to display the cut, copy, paste and other buttons
If you use Android 4.0, it will be displayed on the actionbar and use the actionbar theme style in the style.xml of the application. I found my
"@android:style/Widget.Holo.ActionButton"
Setting minwidth to zero causes the Samsung system to calculate the position of the action button
java.lang.ArithmeticException: divide by zero
Finally, set minwidth to not zero, and the problem is solved