@@ -57,7 +57,8 @@ private void setUpView() {
5757 ImageButton playpauseButton = (ImageButton ) findViewById (R .id .playpause );
5858 playpauseButton .setOnClickListener (new OnClickListener () {
5959
60- public void onClick (View v ) {
60+ @ Override
61+ public void onClick (View v ) {
6162 switch (state ) {
6263 case 1 : setState (2 ); break ; // is playing, set to pause
6364 case 0 : // is stopped, set to play
@@ -71,7 +72,8 @@ public void onClick(View v) {
7172 ImageButton stopButton = (ImageButton ) findViewById (R .id .stop );
7273 stopButton .setOnClickListener (new OnClickListener () {
7374
74- public void onClick (View v ) {
75+ @ Override
76+ public void onClick (View v ) {
7577 setState (0 );
7678 }
7779
@@ -110,18 +112,21 @@ private void setState(int state) {
110112 //////////////////////////////
111113 private int seekbarprogress = 0 ;
112114
113- public void onProgressChanged (SeekBar seekBar , int progress , boolean fromUser ) {
115+ @ Override
116+ public void onProgressChanged (SeekBar seekBar , int progress , boolean fromUser ) {
114117 if (fromUser ) {
115118 seekbarprogress = progress ;
116119 }
117120 }
118121
119- public void onStartTrackingTouch (SeekBar seekBar ) {
122+ @ Override
123+ public void onStartTrackingTouch (SeekBar seekBar ) {
120124 seekbarprogress = 0 ;
121125 if (state == 1 ) pausePlayer ();
122126 }
123127
124- public void onStopTrackingTouch (SeekBar seekBar ) {
128+ @ Override
129+ public void onStopTrackingTouch (SeekBar seekBar ) {
125130 mediaplayer .seekTo (seekbarprogress * 100 );
126131 if (state == 1 ) playPlayer (2 );
127132 seekbarprogress = 0 ;
@@ -135,13 +140,15 @@ private void resetSeekBar() {
135140 }
136141
137142 private final Handler seekbarHandler = new Handler () {
138- public void handleMessage (Message msg ) {
143+ @ Override
144+ public void handleMessage (Message msg ) {
139145 SeekBar seek = (SeekBar ) findViewById (R .id .seek );
140146 seek .setProgress (msg .what );
141147 }
142148 };
143149
144- public void run () {
150+ @ Override
151+ public void run () {
145152 try {
146153 while (state > 0 ) {
147154 Thread .sleep (100 ); // 10th of a second
@@ -175,7 +182,8 @@ private void initializeMediaPlayer() {
175182 }
176183 }
177184
178- public void onCompletion (MediaPlayer mp ) {
185+ @ Override
186+ public void onCompletion (MediaPlayer mp ) {
179187 setState (0 );
180188 }
181189
0 commit comments