Skip to content

Commit e56e1f1

Browse files
committed
reinit the static variables at app launch
1 parent e721f43 commit e56e1f1

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,27 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
6060
super.onCreate(savedInstanceState)
6161
requestWindowFeature(Window.FEATURE_NO_TITLE)
6262
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
63-
mRes = resources
63+
initVariables()
6464
tryInitCamera()
6565
supportActionBar?.hide()
6666
storeStoragePaths()
6767
checkWhatsNewDialog()
6868
setupOrientationEventListener()
6969
}
7070

71+
private fun initVariables() {
72+
mRes = resources
73+
mIsInPhotoMode = false
74+
mIsAskingPermissions = false
75+
mIsCameraAvailable = false
76+
mIsImageCaptureIntent = false
77+
mIsVideoCaptureIntent = false
78+
mIsHardwareShutterHandled = false
79+
mCurrVideoRecTimer = 0
80+
mCurrCameraId = 0
81+
mLastHandledOrientation = 0
82+
}
83+
7184
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
7285
return if (keyCode == KeyEvent.KEYCODE_CAMERA && !mIsHardwareShutterHandled) {
7386
mIsHardwareShutterHandled = true

0 commit comments

Comments
 (0)