Android: Play / Pause song on proximity sensor method -
is there way play , pause song using proximity sensor? wanted play song default state. when user waves hand on proximity sensor, should pause song till time waves again.
i have these code pause when in near / far state. start playing on far / near value. wanted make pause same event , play same event next time.
if(event.values[0]==sensor.getmindelay()) or sensor.getmaximumrange() { log.i("pause","pause"); player.pause(); textview.settext("pause"); } else { log.i("play","play"); player.start(); textview.settext("now playing..!"); }
any / suggestions appreciated.
Comments
Post a Comment