Skip to content

Allow adding activities to the manifest #1213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pythonforandroid/bootstraps/pygame/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
</receiver>
{% endif %}

{% for a in args.add_activity %}
<activity android:name="{{ a }}"></activity>
{% endfor %}

</application>

<uses-sdk android:minSdkVersion="{{ args.min_sdk_version }}" android:targetSdkVersion="{{ args.sdk_version }}"/>
Expand Down
4 changes: 4 additions & 0 deletions pythonforandroid/bootstraps/sdl2/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
</intent-filter>
</receiver>
{% endif %}
{% for a in args.add_activity %}
<activity android:name="{{ a }}"></activity>
{% endfor %}
</application>

</manifest>