Sure, here is a log of the case that causes the problem:

05-19 14:15:08.018: I/abr.main(17259): scan() called
05-19 14:15:08.038: I/abr.main(17259): main activity pausing
05-19 14:15:09.828: I/abr.main(17259): main activity stopping
05-19 14:15:09.828: I/AndroidApplicationHelper(17259): 
AndroidApplicationHelper stop()
05-19 14:15:09.838: I/IOIO_thread(17259): IOIO_thread disconnected
05-19 14:15:09.838: I/AndroidIOIOConnectionManager(17259): 
AndroidIOIOConnectionManager stop()
05-19 14:15:14.068: I/abr.main(17259): main activity restarting
05-19 14:15:14.068: I/abr.main(17259): main activity starting
05-19 14:15:14.068: I/AndroidApplicationHelper(17259): 
AndroidApplicationHelper start()
05-19 14:15:14.068: I/AndroidIOIOConnectionManager(17259): 
AndroidIOIOConnectionManager start()
05-19 14:15:14.068: I/abr.main(17259): main activity resuming

Occasionally, when starting the new activity, the main activity will be 
destroyed. In this case the IOIO connection does come back.

05-19 14:45:19.398: I/abr.main(2984): scan() called
05-19 14:45:19.438: I/abr.main(2984): main activity pausing
05-19 14:45:20.318: I/abr.main(2984): main activity stopping
05-19 14:45:20.318: I/AndroidApplicationHelper(2984): 
AndroidApplicationHelper stop()
05-19 14:45:20.328: I/IOIO_thread(2984): IOIO_thread disconnected
05-19 14:45:20.328: I/AndroidIOIOConnectionManager(2984): 
AndroidIOIOConnectionManager stop()
05-19 14:45:25.868: I/abr.main(2984): main activity being destroyed
05-19 14:45:25.868: I/AndroidApplicationHelper(2984): 
AndroidApplicationHelper destroy()
05-19 14:45:25.868: I/AndroidIOIOConnectionManager(2984): 
AndroidIOIOConnectionManager destroy()
05-19 14:45:25.898: I/abr.main(2984): main activity being created
05-19 14:45:25.958: I/AndroidApplicationHelper(2984): 
AndroidApplicationHelper create()
05-19 14:45:25.958: I/AndroidIOIOConnectionManager(2984): 
AndroidIOIOConnectionManager create()
05-19 14:45:25.968: I/abr.main(2984): main activity starting
05-19 14:45:25.968: I/AndroidApplicationHelper(2984): 
AndroidApplicationHelper start()
05-19 14:45:25.968: I/AndroidIOIOConnectionManager(2984): 
AndroidIOIOConnectionManager start()
05-19 14:45:25.978: I/abr.main(2984): main activity resuming
05-19 14:45:25.988: I/abr.main(2984): main activity pausing
05-19 14:45:26.018: I/abr.main(2984): main activity resuming

On Monday, May 18, 2015 at 9:18:12 PM UTC-7, Ytai wrote:
>
> Can you add some logs and figure out the exact sequence of lifecycle calls 
> (e.g. onStart(), onStop(), etc.) in your scenario? Also include the 
> relevant IOIO logs so we can see whether a connection is closed properly 
> before switching.
>
> On Mon, May 18, 2015 at 3:15 PM, Tiffany Hwu <[email protected] 
> <javascript:>> wrote:
>
>> I have a main activity that extends IOIOActivity. Within this main 
>> activity I have function called scan(), which calls 
>> startActivityForResult() to open up a new activity to scan a QR code using 
>> the Android phone. The usual life cycle for main activity in this case is 
>> to pause, stop, let the QR activity scan, start, then resume. Accordingly, 
>> I think the  
>>
>> IOIOAndroidApplicationHelper should reestablish the IOIO connection at 
>> the start stage. However, this doesn't happen and the IOIO connection is 
>> gone when the main activity resumes. Any ideas on why this is happening? I 
>> can post some code if more clarity is needed. Thanks!
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "ioio-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/ioio-users.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to