Skip to content

Commit c61c36a

Browse files
authored
Merge pull request kivy#1213 from bauerj/add-activity
Allow adding activities to the manifest
2 parents dc035ff + e0483aa commit c61c36a

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

pythonforandroid/bootstraps/pygame/build/build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ def make_package(args):
241241
# Annoying fixups.
242242
args.name = args.name.replace('\'', '\\\'')
243243
args.icon_name = args.icon_name.replace('\'', '\\\'')
244+
args.add_activity = args.add_activity or []
244245

245246
# Figure out versions of the private and public data.
246247
private_version = str(time.time())
@@ -475,6 +476,8 @@ def parse_args(args=None):
475476
help='Custom key=value to add in strings.xml resource file')
476477
ap.add_argument('--manifest-extra', dest='manifest_extra', action='append',
477478
help='Custom file to add at the end of the manifest')
479+
ap.add_argument('--add-activity', dest='add_activity', action='append',
480+
help='Add this Java class as an Activity to the manifest.')
478481

479482
if args is None:
480483
args = sys.argv[1:]

pythonforandroid/bootstraps/pygame/build/templates/AndroidManifest.tmpl.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@
9494
</receiver>
9595
{% endif %}
9696

97+
{% for a in args.add_activity %}
98+
<activity android:name="{{ a }}"></activity>
99+
{% endfor %}
100+
97101
</application>
98102

99103
<uses-sdk android:minSdkVersion="{{ args.min_sdk_version }}" android:targetSdkVersion="{{ args.sdk_version }}"/>

pythonforandroid/bootstraps/sdl2/build/build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ def make_package(args):
293293
if args.intent_filters:
294294
with open(args.intent_filters) as fd:
295295
args.intent_filters = fd.read()
296+
297+
args.add_activity = args.add_activity or []
296298

297299
if args.extra_source_dirs:
298300
esd = []
@@ -508,6 +510,8 @@ def parse_args(args=None):
508510
ap.add_argument('--sign', action='store_true',
509511
help=('Try to sign the APK with your credentials. You must set '
510512
'the appropriate environment variables.'))
513+
ap.add_argument('--add-activity', dest='add_activity', action='append',
514+
help='Add this Java class as an Activity to the manifest.')
511515

512516
if args is None:
513517
args = sys.argv[1:]

pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@
119119
</intent-filter>
120120
</receiver>
121121
{% endif %}
122+
{% for a in args.add_activity %}
123+
<activity android:name="{{ a }}"></activity>
124+
{% endfor %}
122125
</application>
123126

124127
</manifest>

0 commit comments

Comments
 (0)