• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Changing Button Color base on mp3?

abotrix

Lurker
Hi, first post!! I had wanted the button on my app to be green after touching the button from grey while playing mp3, and then change back when mp3 is finishing. The first part work if I press the button but after the mp3 stops, it stays green. Any help appreciated!:o My code:

Code:
      synthA.setOnClickListener(new View.OnClickListener(){
        	@Override
        	public void onClick(View v){
        		mpBntClick.start();
        		mpBntClick.setLooping(false);
        		myVib.vibrate(50);
        		if (mpBntClick.isPlaying() == true){
        			synthA.getBackground().setColorFilter(0xFF00FF00, PorterDuff.Mode.MULTIPLY);
        		}
        		else if (mpBntClick.isPlaying() == false){
        			synthA.getBackground().setColorFilter(0xFFFAFAFA, PorterDuff.Mode.MULTIPLY);
        		}
        	}
        });
 
Back
Top Bottom