diff --git a/pythonforandroid/bootstraps/pygame/build/build.py b/pythonforandroid/bootstraps/pygame/build/build.py index 730ad827f6..d9f2dfddfc 100755 --- a/pythonforandroid/bootstraps/pygame/build/build.py +++ b/pythonforandroid/bootstraps/pygame/build/build.py @@ -241,6 +241,7 @@ def make_package(args): # Annoying fixups. args.name = args.name.replace('\'', '\\\'') args.icon_name = args.icon_name.replace('\'', '\\\'') + args.add_activity = args.add_activity or [] # Figure out versions of the private and public data. private_version = str(time.time()) @@ -475,6 +476,8 @@ def parse_args(args=None): help='Custom key=value to add in strings.xml resource file') ap.add_argument('--manifest-extra', dest='manifest_extra', action='append', help='Custom file to add at the end of the manifest') + ap.add_argument('--add-activity', dest='add_activity', action='append', + help='Add this Java class as an Activity to the manifest.') if args is None: args = sys.argv[1:] diff --git a/pythonforandroid/bootstraps/pygame/build/templates/AndroidManifest.tmpl.xml b/pythonforandroid/bootstraps/pygame/build/templates/AndroidManifest.tmpl.xml index 050a7d2308..9766d14dbf 100644 --- a/pythonforandroid/bootstraps/pygame/build/templates/AndroidManifest.tmpl.xml +++ b/pythonforandroid/bootstraps/pygame/build/templates/AndroidManifest.tmpl.xml @@ -94,6 +94,10 @@ {% endif %} + {% for a in args.add_activity %} + + {% endfor %} + diff --git a/pythonforandroid/bootstraps/sdl2/build/build.py b/pythonforandroid/bootstraps/sdl2/build/build.py index 12f7042d8d..73fbb94c24 100755 --- a/pythonforandroid/bootstraps/sdl2/build/build.py +++ b/pythonforandroid/bootstraps/sdl2/build/build.py @@ -293,6 +293,8 @@ def make_package(args): if args.intent_filters: with open(args.intent_filters) as fd: args.intent_filters = fd.read() + + args.add_activity = args.add_activity or [] if args.extra_source_dirs: esd = [] @@ -508,6 +510,8 @@ def parse_args(args=None): ap.add_argument('--sign', action='store_true', help=('Try to sign the APK with your credentials. You must set ' 'the appropriate environment variables.')) + ap.add_argument('--add-activity', dest='add_activity', action='append', + help='Add this Java class as an Activity to the manifest.') if args is None: args = sys.argv[1:] diff --git a/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml b/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml index 8db3b2f451..b9b04ee5a3 100644 --- a/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml +++ b/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml @@ -119,6 +119,9 @@ {% endif %} + {% for a in args.add_activity %} + + {% endfor %}