silverlight - Disable DispatcherTimer while a phone call is active on WP7 -
my wp7 (silverlight) app keeps getting rejected because "should not continue vibrating in case of incoming phone call". however, reacting on applicaton_deactivated
event not allow me fix problem since method not called on incoming phone call...
the problematic vibration done through dispatchertimer
, keeps running in background behind phone call. moving execution main thread didn't change anything.
do apps continue running behind phone calls? or there way stop vibration?
initialization of vibrator , timer:
vibrator = vibratecontroller.default; vibratortimer = new dispatchertimer(); vibratortimer.tick += new eventhandler(vibraterepatedly); vibratortimer.interval = new timespan(0, 0, 0, 0, uiconstants.vibration_interval); vibrationspan = new timespan(0, 0, 0, 0, uiconstants.vibration_duration);
tick method:
private void vibraterepatedly(object sender, eventargs e) { vibrator.start(vibrationspan); }
during incoming call obscured event
called , not application_deactivated event
. obscured event in app, can't distinguish if due incoming call, incoming sms or reminder.
here link msdn documentation of obscured event get. there corresponding unobscured event
can detect.
Comments
Post a Comment