ZubeidHendricks / hackerskeyboard

Automatically exported from code.google.com/p/hackerskeyboard
0 stars 0 forks source link

NullPointerException when typing "n-" on second function (fn) key tap to return to standard QWERTY mode. #269

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. open any app to start typing (I used Gmail and focus on Subject)
2. type "n-" (example: 'n', 'fn', '-', 'fn')
3. should crash on the 2nd "fn" press.

I'm using the 5-row compact layout in portrait mode with experimental compact 
5-row keyboard mode enabled.

What is the expected behavior? What do you see instead?
- not crash :), crash.

What version of Hacker's Keyboard are you using? (See "Debug" section at
the bottom of the app's Settings menu.)
- 1.33.1332 d27b5144b8e2 2012-07-03

On what phone or tablet?
- Galaxy Note AT&T

If applicable, does this affect the 4-row or 5-row layout, or both? Which 
language(s)?
- 5 row, english

Please provide any additional information below.

Based on the stack trace and the code, "mSpaceKey" is null.

I'm not familiar enough with the code base to quickly see when mSpaceKey is 
initialized, but I'm surprised it would ever be null since it's drawn correctly 
when the keyboard is first displayed.

If this isn't a trivial issue, I might checkout the source and try to fix this 
myself, but again, I'm hoping since you're more familiar with the source than I 
am it would be easy enough to figure out.

======= begin stack trace ==============
E/AndroidRuntime(  662): FATAL EXCEPTION: main
E/AndroidRuntime(  662): java.lang.NullPointerException
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.LatinKeyboard.updateSpaceBarForLocale(LatinKeyb
oard.java:411)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.LatinKeyboard.onAutoCompletionStateChanged(Lati
nKeyboard.java:392)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.KeyboardSwitcher.onAutoCompletionStateChanged(K
eyboardSwitcher.java:662)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.LatinIME.onAutoCompletionStateChanged(LatinIME.
java:3897)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.CandidateView.onDraw(CandidateView.java:285)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.CandidateView.setSuggestions(CandidateView.java
:333)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.LatinIME.setSuggestions(LatinIME.java:2740)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.LatinIME.showSuggestions(LatinIME.java:2813)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.LatinIME.showSuggestions(LatinIME.java:2806)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.LatinIME.updateSuggestions(LatinIME.java:2758)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.LatinIME.access$200(LatinIME.java:90)
E/AndroidRuntime(  662):    at 
org.pocketworkstation.pckeyboard.LatinIME$1.handleMessage(LatinIME.java:382)
E/AndroidRuntime(  662):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  662):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(  662):    at 
android.app.ActivityThread.main(ActivityThread.java:4511)
E/AndroidRuntime(  662):    at java.lang.reflect.Method.invokeNative(Native 
Method)
E/AndroidRuntime(  662):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(  662):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:976)
E/AndroidRuntime(  662):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743)
E/AndroidRuntime(  662):    at dalvik.system.NativeStart.main(Native Method)

Original issue reported on code.google.com by ddrscott on 27 Jul 2012 at 10:16

GoogleCodeExporter commented 8 years ago
Sorry about not responding earlier - I can't reproduce this issue, is this 
still happening in current versions?

Original comment by Klaus.We...@gmail.com on 22 Jan 2013 at 6:07

GoogleCodeExporter commented 8 years ago
I just downloaded v1.34rc8 from google code, and it is still occuring.

Here's the settings I'm using:
=====================
Keyboard height, portait: 40%
Keyboard height, landscape: 45%
Keyboard mode, portrait: 5-row compact layout (US QWERT only!)
Keyboard mode, landscape: Full 5-row layout
Suggestions in landscape mode: unchecked
Theme and label settings:
  Labeled alternate keys: show ASCII punctuation
  Key label scaling: 110%
  Suggestion label scaling: 90%
  5th row height adjustment: 80%
  Keyboard Theme: Ice Cream Sandwich
  Enable compact 5-row keyboard mode: checked
  Drawing method: Software buffered (default)
Show settings key: automatic
Voice input: Mic on main keyboard
Input languages: Slide finter on spacebar to change language
Auto-capitalization: checked
Double-tap shift mode: checked
Apply Shift Lock to modifier keys?: checked
Key feedback settings: unchecked, 40ms, unchecked, System default (ignore click 
volume), 20%, checked
Gesture and key actions: Toggle extension row, Close keyboard, no action, no 
action, no action, no action

There's too many to type. I believe the rest of the settings are default. Let 
me know if you still can't reproduce it.

Steps for reproducing are:
  1. open up Gmail.
  2. compose new email.
  3. tap Subject Line (hackers keyboard should appear automatically)
  4. tap "n" (should auto-capitalize) to "N"
  5. tap "Fn" key
  6. tap "-" key (between "`" and "=")
  7. tap "Fn" key (should crash)

E/AndroidRuntime(27784): FATAL EXCEPTION: main
E/AndroidRuntime(27784): java.lang.NullPointerException
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinKeyboard.drawSpaceBar(LatinKeyboard.java:4
95)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinKeyboard.updateSpaceBarForLocale(LatinKeyb
oard.java:408)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinKeyboard.onAutoCompletionStateChanged(Lati
nKeyboard.java:392)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.KeyboardSwitcher.onAutoCompletionStateChanged(K
eyboardSwitcher.java:662)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinIME.onAutoCompletionStateChanged(LatinIME.
java:3958)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.CandidateView.onDraw(CandidateView.java:285)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.CandidateView.setSuggestions(CandidateView.java
:333)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinIME.setSuggestions(LatinIME.java:2759)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinIME.showSuggestions(LatinIME.java:2832)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinIME.showSuggestions(LatinIME.java:2825)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinIME.updateSuggestions(LatinIME.java:2777)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinIME.access$200(LatinIME.java:90)
E/AndroidRuntime(27784):    at 
org.pocketworkstation.pckeyboard.LatinIME$1.handleMessage(LatinIME.java:383)
E/AndroidRuntime(27784):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(27784):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(27784):    at 
android.app.ActivityThread.main(ActivityThread.java:4978)
E/AndroidRuntime(27784):    at java.lang.reflect.Method.invokeNative(Native 
Method)
E/AndroidRuntime(27784):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(27784):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(27784):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
E/AndroidRuntime(27784):    at dalvik.system.NativeStart.main(Native Method)

Original comment by ddrscott on 22 Jan 2013 at 3:17

GoogleCodeExporter commented 8 years ago
Thanks for the additional details. I still can't reproduce it, but will add a 
check to the function anyway which should avoid the crash. See revision 
161130473a22, this will be included in the next prerelease.

Does this happen only for the "-" key, or also for other keys on the Fn 
keyboard?

FYI, you can also get the "-" key by long-pressing the "3" key to get the 
alternate, I think that's quicker than using the Fn map. 

Original comment by Klaus.We...@gmail.com on 22 Jan 2013 at 7:15

GoogleCodeExporter commented 8 years ago
Other "Fn" keys work fine.

I noticed when I press "n" it underscores it for auto complete and the 
underscore continues when I press "Fn"+"-". But when I press something else 
like "n", "Fn", "}" the underscore goes away and there's no crash.

FYI: long pressing "3" has been my work around, but it breaks my typing rythme 
because I have to wait. (I have shortened the delay so it's not as long)

Thanks for putting the Null check in there. Hopefully it doesn't have any other 
side effects. I'll try to keep an eye out the next RC to test if for you.

Original comment by ddrscott on 22 Jan 2013 at 7:21

GoogleCodeExporter commented 8 years ago
Thanks! Marking as "Fixed", I'll update the bug status to "FixInTest" once 
there's a release candidate available that includes it.

Original comment by Klaus.We...@gmail.com on 22 Jan 2013 at 7:35

GoogleCodeExporter commented 8 years ago
Please try v1.34rc9 (or later) and let me know if this fixes the issue for you:
https://code.google.com/p/hackerskeyboard/downloads/list

Original comment by Klaus.We...@gmail.com on 23 Jan 2013 at 6:14

GoogleCodeExporter commented 8 years ago
All better. Thanks for your help.

Original comment by ddrscott on 23 Jan 2013 at 6:52

GoogleCodeExporter commented 8 years ago
[bulk bug update]

The changes from the 1.34rcX prerelease series are included in version 1.37 as 
published on the Play Store, and this bug should be fixed. If it's still not 
working for you, please reopen or file a new bug. Thanks to everyone who helped 
with finding bugs and testing!

Original comment by Klaus.We...@gmail.com on 26 Dec 2013 at 7:12