Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!cond1 ) {
- b1.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- audio_buongiorno.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
- @Override
- public void onCompletion(MediaPlayer mp) {
- b1.setBackgroundResource(android.R.drawable.btn_default);
- b1.setText("Buongiorno Buonasera");
- Log.v("cond","cond 1 stop "+cond1);
- cond1 = false;
- }
- });
- audio_buongiorno.start();
- b1.setBackgroundColor(Color.RED);
- b1.setText("Riproduzione in corso . . .");
- cond1 = true;
- Log.v("cond", "cond 1 " + cond1);
- }
- });
- }
- if(cond1) {
- b1.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- audio_buongiorno.stop();
- b1.setBackgroundResource(android.R.drawable.btn_default);
- b1.setText("Buongiorno Buonasera");
- cond1 = false;
- Log.v("cond", "cond 2 " + cond1);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement