Hi there,
I am trying to set the background dynamically as I play music.
1) I am able to set the background using the setBackground
(Color.GREEN) method.
2) Then I play a MP3 file (audio) using the MediaPlayer.
3) when I call myPlayer().isPlaying(), I would like to keep changing
the background color continiously till the music stops. I tried this
way,
setContentView(R.layout.main);
//startStreamingAudio();
tv = new TextView(this);
tv.setBackgroundColor(Color.GREEN);
tv.setTextColor(Color.WHITE);
tv.setText("Do you hear me!");
setContentView(tv);
mp = MediaPlayer.create(getApplicationContext(),
R.raw.organ_1);
mp.start();
while(mp.isPlaying()){
i += 20;
tv.setBackgroundColor(Color.rgb(i, 100, 100));
setContentView(tv);
}
It changes only at the end of the sound file. Can someone help me find
the right way towards this ?
thanks
Di
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---