Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I want to run a task every time my phone loses connection to my truck's bluetooth device.

I can see a way to run a task when it connects, and obviously I can "invert" it, but inverting it doesn't sound right to me.

What is the right way to run a task upon BT connection loss to a specific device?

share|improve this question
    
That's obviously the only choice you've got. I'd introduce a variable to it: BT Connected -> %MYVAR = 1. Then combine: !BT-Connected & Isset %MYVAR => just lost connection; unset %MYVAR. !BT-Connected & !Isse %MYVAR would be "lost it a while before". Just to give you a pattern to play with :) –  Izzy Jan 17 '13 at 23:05
    
I was looking for "Exit Tasks" –  Chase Florell Jan 18 '13 at 3:28
    
Yuck sure -- why didn't I think about those!?! I even use them myself... –  Izzy Jan 18 '13 at 7:00
add comment

1 Answer

up vote 5 down vote accepted

Create a profile that is active when connected to the Bluetooth device and set up an exit task to run whatever you want when the profile becomes inactive due to the device disconnects.

share|improve this answer
    
Ah, I see where that is now. You can create an "Exit Task" from the profiles screen... I didn't see how to do that before. Thanks –  Chase Florell Jan 18 '13 at 3:03
    
So when I connect to that specific Bluetooth device, I clear my %PARKINGLOCATION variable, and when the profile EXITS, then I set the %PARKINGLOCATION to %LOC, which sets the lat/long of the current location. –  Chase Florell Jan 18 '13 at 3:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.