null keyevent and actionid = 0 in onEditorAction() (Jelly Bean / Nexus 7)

Ended up adding in a null check for KeyEvent. Thanks to commonsware for pointing out this happens on 3.0+. Seems more like a workaround then a solution, but it works. // Search field logic. @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Log.d(TAG, “onEditorAction”); if (event != null && event.getAction() != KeyEvent.ACTION_DOWN) { … Read more

Android 4.2 on Nexus 7: canvas.drawText() not working correctly

I answer my own question after a lot of googling… The trick consist in the use of setLinearText(true) for the Paint object used for drawing the text. Now, everything looks great. paint = new Paint(); paint.setAntiAlias(true); paint.setColor(color); paint.setTextSize(size); paint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); paint.setTextAlign(Align.CENTER); paint.setLinearText(true); Here the link that saves my day: http://gc.codehum.com/p/android/issues/detail?id=39755 I hope it can help someonelse. … Read more

Error running systrace tool in ADB using a Jelly Bean 4.1 emulator on Windows 7

The systrace python script uses the select() system call, and that doesn’t work on Windows. The latest preview (ADT21 rc9) of the Android SDK tools include support for collecting system trace from within the monitor tool. Launch monitor as: ./tools/monitor & Click on a device, and at the top right of the device panel, you … Read more

How to hide the soft-key bar on Android phone?

I know its late but it is the right answer so what you are trying to do is what called immersive mode. for (API 19) check out: https://developer.android.com/training/system-ui/immersive.html The code that you were asking for is: @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) { getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | … Read more