Skip to content

Instantly share code, notes, and snippets.

@neosinan
Last active June 7, 2016 16:38
Show Gist options
  • Save neosinan/ad870877c5ab91a952ba67c8b1be9f14 to your computer and use it in GitHub Desktop.
Save neosinan/ad870877c5ab91a952ba67c8b1be9f14 to your computer and use it in GitHub Desktop.
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
Intent Ourintent2 = new Intent(Listening.this, MyService.class);
Ourintent2.putExtra("dek1", dek1);
startService(Ourintent2);
bool = true;
} else {
try{
//MyService.initMediaPlayers();
}catch (Exception e){
stopService(new Intent(getBaseContext(), MyService.class));
}
bool = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment