Skip to content

Commit b64174b

Browse files
manuqrtibbles
authored andcommitted
Android manifest XML: Pass activity meta-data
Allow passing meta-data fields to the activity.
1 parent 963dbaa commit b64174b

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

pythonforandroid/bootstraps/common/build/build.py

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,8 @@ def create_argument_parser():
819819
help='The permissions to give this app.', nargs='+')
820820
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],
821821
help='Custom key=value to add in application metadata')
822+
ap.add_argument('--activity-meta-data', dest='activity_meta_data', action='append', default=[],
823+
help='Custom key=value to add in activity metadata')
822824
ap.add_argument('--uses-library', dest='android_used_libs', action='append', default=[],
823825
help='Used shared libraries included using <uses-library> tag in AndroidManifest.xml')
824826
ap.add_argument('--asset', dest='assets',

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
{%- if args.intent_filters -%}
9393
{{- args.intent_filters -}}
9494
{%- endif -%}
95+
{% for m in args.activity_meta_data %}
96+
<meta-data android:name="{{ m.split('=', 1)[0] }}" android:value="{{ m.split('=', 1)[-1] }}"/>{% endfor %}
9597
</activity>
9698

9799
{% if args.launcher %}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
{%- if args.intent_filters -%}
6767
{{- args.intent_filters -}}
6868
{%- endif -%}
69+
{% for m in args.activity_meta_data %}
70+
<meta-data android:name="{{ m.split('=', 1)[0] }}" android:value="{{ m.split('=', 1)[-1] }}"/>{% endfor %}
6971
</activity>
7072

7173
{% if service %}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@
7575
{%- if args.intent_filters -%}
7676
{{- args.intent_filters -}}
7777
{%- endif -%}
78+
{% for m in args.activity_meta_data %}
79+
<meta-data android:name="{{ m.split('=', 1)[0] }}" android:value="{{ m.split('=', 1)[-1] }}"/>{% endfor %}
7880
</activity>
7981

8082
{% if service %}

0 commit comments

Comments
 (0)