From a4516a966ecdbc423bdcad363d05faab4fb492a1 Mon Sep 17 00:00:00 2001 From: Ryan Pessa Date: Wed, 21 Jan 2015 10:12:57 -0600 Subject: [PATCH] fix android package for services --- recipes/android/src/android/_android.pyx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/recipes/android/src/android/_android.pyx b/recipes/android/src/android/_android.pyx index 99e51fce2d..28459f4ebe 100644 --- a/recipes/android/src/android/_android.pyx +++ b/recipes/android/src/android/_android.pyx @@ -181,13 +181,16 @@ version_codes = autoclass('android.os.Build$VERSION_CODES') python_act = autoclass('org.renpy.android.PythonActivity') rctx = autoclass('android.graphics.Rect')() mActivity = python_act.mActivity -decor_view = mActivity.getWindow().getDecorView() -height = mActivity.getWindowManager().getDefaultDisplay().getHeight() -# get keyboard height -def get_keyboard_height(): - decor_view.getWindowVisibleDisplayFrame(rctx) - return height - rctx.bottom - +if mActivity: + decor_view = mActivity.getWindow().getDecorView() + height = mActivity.getWindowManager().getDefaultDisplay().getHeight() + # get keyboard height + def get_keyboard_height(): + decor_view.getWindowVisibleDisplayFrame(rctx) + return height - rctx.bottom +else: + def get_keyboard_height(): + return 0 # Flags for input_type, for requesting a particular type of keyboard #android FLAGS