Create voice in onStart, stop it in onStop. This way, if some other
application is in use, the voice won't be annoying you.
Signed-off-by: Keith Packard <keithp@keithp.com>
for (AltosDroidTab mTab : mTabs)
mTab.update_ui(state, from_receiver, location, mTab == mTabsAdapter.currentItem());
for (AltosDroidTab mTab : mTabs)
mTab.update_ui(state, from_receiver, location, mTab == mTabsAdapter.currentItem());
+ if (state != null && mAltosVoice != null)
mAltosVoice.tell(state, from_receiver);
saved_state = state;
mAltosVoice.tell(state, from_receiver);
saved_state = state;
mStateLayout = (RelativeLayout) findViewById(R.id.state_container);
mStateView = (TextView) findViewById(R.id.state_value);
mAgeView = (TextView) findViewById(R.id.age_value);
mStateLayout = (RelativeLayout) findViewById(R.id.state_container);
mStateView = (TextView) findViewById(R.id.state_value);
mAgeView = (TextView) findViewById(R.id.age_value);
-
- mAltosVoice = new AltosVoice(this);
+ if (mAltosVoice == null)
+ mAltosVoice = new AltosVoice(this);
if(D) Log.e(TAG, "-- ON STOP --");
doUnbindService();
if(D) Log.e(TAG, "-- ON STOP --");
doUnbindService();
+ if (mAltosVoice != null) {
+ mAltosVoice.stop();
+ mAltosVoice = null;
+ }