Charge battery and play while device is on, charge battery while device is off. How can this be done?

Working on a small project and I've hit a small bump.  My device has internal batteries that I want to charge while it is plugged in and turned on, and then when I switch the device off, the batteries still charge while it is plugged in.

I'm using Li-ion and yes, I have a charging/protection circuit for them.  So through that circuit, they can be hooked up normally.  I also have a power regulator attached to the main device.  So it can't get fried.

I'm hoping to accomplish this through a switch.  Maybe DPDT?  But I'm unsure how to wire it.  I tried one way with a DPDT and it just stays on...

Re-design7 years ago
Regulate the output of the battery so that you limit the voltage going to the device.

Connect the charger to the battery.

You can now charge while you play, charge while you don't play.  This is how a phone, radio etc. charges in all states.
3VIL G3NIUS7 years ago
 Couldn't you just have the battery charge circuit continuously hooked up to the battery and just switch the wire going from the battery to what ever your device is?
else you could have the charger separate from the battery and circuit and just plug it in to charge. like portable devices.
stalledaction (author)  3VIL G3NIUS7 years ago,2845,1769845,00.asp

This seemed to be exactly what I was looking for.  But thanks Evil.