MrLoick / python-for-android

Automatically exported from code.google.com/p/python-for-android
Apache License 2.0
0 stars 0 forks source link

Standalone APK package can‘t run background #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi my friend:
   I compiled my python script to the APK file.I installed it and it worked well.But when I press "home" back to the background,and restart the program,the program force close.
   Is there any code can make the script running background.
   I'm sorry for my poor English.

Best Regards

Original issue reported on code.google.com by tony537...@gmail.com on 7 Jul 2011 at 2:12

GoogleCodeExporter commented 9 years ago
Hi, this problem is actually of the SL4A stand alone template.

Try adding:
android:configChanges="keyboardHidden|orientation"

To the <application> declaration.

Original comment by naranjo....@gmail.com on 7 Jul 2011 at 5:45

GoogleCodeExporter commented 9 years ago
thx very much!
I'll try it again.

Original comment by tony537...@gmail.com on 8 Jul 2011 at 2:29

GoogleCodeExporter commented 9 years ago
I found that the code 
android:configChanges="keyboardHidden|orientation"
already exist in AndroidManifest.xml 

like this:

 <activity
      android:configChanges="keyboardHidden|orientation"
      android:name="com.googlecode.android_scripting.activity.FutureActivity" 
      android:theme="@android:style/Theme.Translucent"/>

Original comment by tony537...@gmail.com on 9 Jul 2011 at 1:10

GoogleCodeExporter commented 9 years ago
I dont't know how to modify it.
Is anybody know? Please help me!
Thank you.

Original comment by tony537...@gmail.com on 9 Jul 2011 at 1:12

GoogleCodeExporter commented 9 years ago
Should look like this:

  <application
    android:debuggable="true"
    android:icon="@drawable/script_logo_48"
    android:label="@string/app_name"
    android:name=".ScriptApplication"
    android:configChanges="keyboardHidden|orientation">

Original comment by naranjo....@gmail.com on 9 Jul 2011 at 2:25

GoogleCodeExporter commented 9 years ago

Original comment by rjmatthews62 on 3 Apr 2012 at 2:19