Skip to content

Commit

Permalink
Prevent re-binding of callback on each call (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen-CODE committed Jan 3, 2020
1 parent 46216b2 commit 3e55526
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plyer/platforms/android/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def __init__(self, *args, **kwargs):
self.select_code = randint(123456, 654321)
self.selection = None

# bind a function for a response from filechooser activity
activity.bind(on_activity_result=self._on_activity_result)

@staticmethod
def _handle_selection(selection): # pylint: disable=method-hidden
'''
Expand Down Expand Up @@ -116,9 +119,6 @@ def _open_file(self, **kwargs):
Intent.CATEGORY_OPENABLE
)

# bind a function for a response from filechooser activity
activity.bind(on_activity_result=self._on_activity_result)

# start a new activity from PythonActivity
# which creates a filechooser via intent
mActivity.startActivityForResult(
Expand Down

0 comments on commit 3e55526

Please sign in to comment.