Fixed bug in the mediaplayer

This commit is contained in:
daniel oeh 2012-06-24 13:01:44 +02:00
parent d8d4d28602
commit 7cd38e53a7
3 changed files with 14 additions and 5 deletions

View File

@ -21,7 +21,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:text="left" /> android:text="@string/position_default_label" />
<TextView <TextView
android:id="@+id/txtvLength" android:id="@+id/txtvLength"
@ -29,7 +29,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:text="right" /> android:text="@string/position_default_label" />
<TextView <TextView
android:id="@+id/txtvStatus" android:id="@+id/txtvStatus"

View File

@ -58,4 +58,5 @@
<string name="mark_all_read_label">Mark all read</string> <string name="mark_all_read_label">Mark all read</string>
<string name="show_info_label">Show information</string> <string name="show_info_label">Show information</string>
<string name="remove_feed_label">Remove Feed</string> <string name="remove_feed_label">Remove Feed</string>
<string name="position_default_label">00:00:00</string>
</resources> </resources>

View File

@ -59,8 +59,16 @@ public class MediaplayerActivity extends SherlockActivity {
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
Log.d(TAG, "Activity stopped"); Log.d(TAG, "Activity stopped");
unregisterReceiver(statusUpdate); try {
unbindService(mConnection); unregisterReceiver(statusUpdate);
} catch (IllegalArgumentException e) {
// ignore
}
try {
unbindService(mConnection);
} catch (IllegalArgumentException e) {
// ignore
}
if (positionObserver != null) { if (positionObserver != null) {
positionObserver.cancel(true); positionObserver.cancel(true);
} }
@ -158,7 +166,7 @@ public class MediaplayerActivity extends SherlockActivity {
butPlay.setImageResource(android.R.drawable.ic_media_play); butPlay.setImageResource(android.R.drawable.ic_media_play);
break; break;
case SEEKING: case SEEKING:
setStatusMsg(R.string.player_seeking_msg, View.VISIBLE); setStatusMsg(R.string.player_seeking_msg, View.VISIBLE);
} }
} }