Skip to content

Commit

Permalink
Activity was imported twice
Browse files Browse the repository at this point in the history
  • Loading branch information
trivedigaurav committed Jun 29, 2014
1 parent ff52259 commit a060092
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions plyer/platforms/android/camera.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

import android
import android.activity
from os import unlink
from jnius import autoclass, cast
from plyer.facades import Camera
Expand All @@ -18,8 +15,8 @@ def _take_picture(self, on_complete, filename=None):
assert(on_complete is not None)
self.on_complete = on_complete
self.filename = filename
android.activity.unbind(on_activity_result=self._on_activity_result)
android.activity.bind(on_activity_result=self._on_activity_result)
activity.unbind(on_activity_result=self._on_activity_result)
activity.bind(on_activity_result=self._on_activity_result)
intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
uri = Uri.parse('file://' + filename)
parcelable = cast('android.os.Parcelable', uri)
Expand All @@ -29,7 +26,7 @@ def _take_picture(self, on_complete, filename=None):
def _on_activity_result(self, requestCode, resultCode, intent):
if requestCode != 0x123:
return
android.activity.unbind(on_activity_result=self._on_activity_result)
activity.unbind(on_activity_result=self._on_activity_result)
if self.on_complete(self.filename):
self._unlink(self.filename)

Expand Down

0 comments on commit a060092

Please sign in to comment.