You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the issue is reproductible in the following scenario:
Let's say we have two Activities A and B.
The user wants initialize the CaptureONLY on demand, in this case for example we add a button that handle Capture.init in the activity A (till now everything OK).
note = until now in the CaptureActivityLifecycleCallbacks, the activityCount = 0
Now we navigate from the activity A to Activity B
onActivityStarted (B) will be called (activityCount == 0 => FOREGROUND ; activityCount ++ => activityCount =1 => Capture connect )
onActivityStopped (A) will be called after ( activityCount -- => activityCount = 0 ; BACKGROUND => Capture Disconnect)
As we see here, once we are in B activity, the state of Capture is Disconnected !
class ActivityA : AppCompatActivity() {
.....
override fun onCreate(savedInstanceState: Bundle?) {
.....
binding.initSocket.setOnClickListener {
Capture.builder(getApplicationContext())
.enableLogging(BuildConfig.DEBUG)
.build()
Capture.connect{}
}
binding.goToB.setOnClickListener {
//till now every thing works fine
startActivity(Intent(this, ActivityB::class.java))
}
}
}
class ActivityB : AppCompatActivity() {
.....
//my Capture is not connected any more , even if we go back to ActivityA
}
As solution for this issue, i think it will be better to add in CaptureActivityLifecycleCallbacks class a List of started activities , and we change visibility to gone only the already started activities... In resume we stop only started activities.
Or add some method to increment activityCount manually
The text was updated successfully, but these errors were encountered:
the issue is reproductible in the following scenario:
Let's say we have two Activities
A
andB
.The user wants initialize the
Capture
ONLY on demand, in this case for example we add a button that handleCapture.init
in the activityA
(till now everything OK).note = until now in the
CaptureActivityLifecycleCallbacks,
theactivityCount = 0
Now we navigate from the activity
A
to ActivityB
B
) will be called(activityCount
== 0 =>FOREGROUND
;activityCount ++
=> activityCount =1 =>Capture
connect )A
) will be called after (activityCount --
=>activityCount
= 0 ;BACKGROUND
=>Capture
Disconnect)As we see here, once we are in
B
activity, the state ofCapture
is Disconnected !As solution for this issue, i think it will be better to add in
CaptureActivityLifecycleCallbacks
class a List of started activities , and we change visibility to gone only the already started activities... In resume we stop only started activities.Or add some method to increment
activityCount
manuallyThe text was updated successfully, but these errors were encountered: