-
-
Save codingwithsara/31b2c00303a6c0f41c369ba25608f9a8 to your computer and use it in GitHub Desktop.
Android MusicPlayer 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Handler handler = new Handler(new Handler.Callback() { | |
@Override | |
public boolean handleMessage(Message msg) { | |
int currentPosition = msg.what; | |
// 再生位置を更新 | |
positionBar.setProgress(currentPosition); | |
// 経過時間ラベル更新 | |
String elapsedTime = createTimeLabel(currentPosition); | |
elapsedTimeLabel.setText(elapsedTime); | |
// 残り時間ラベル更新 | |
String remainingTime = "- " + createTimeLabel(totalTime - currentPosition); | |
remainingTimeLabel.setText(remainingTime); | |
return true; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment