Skip to content
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

Choose a reasonable and valid number for the intent code #790

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions plyer/platforms/android/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class AndroidFileChooser(FileChooser):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.select_code = randint(123456, 654321)
self.save_code = randint(123456, 654321)
self.select_code = randint(100, 65536-1) # 65536 is the maximum (16 bits. see https://stackoverflow.com/a/39789838/12269724). 100 to avoid possible conflicts with the system.
self.save_code = self.select_code+1 # just to avoid possible conflicts
self.selection = None

# bind a function for a response from filechooser activity
Expand Down