android:paddingBottom="6dp"
android:background="@color/lyrics_background_color"
android:textColor="@color/white"
- android:textSize="@dimen/text_size_small"/>
+ android:textSize="@dimen/text_size_small"
+ android:alpha="0.0"/>
</com.cyanogenmod.eleven.widgets.SquareFrame>
<RelativeLayout
private long[] mAutoShuffleList = null;
private MusicPlayerHandler mPlayerHandler;
+ private HandlerThread mHandlerThread;
private BroadcastReceiver mUnmountReceiver = null;
// separate thread because the service normally runs in the process's
// main thread, which we don't want to block. We also make it
// background priority so CPU-intensive work will not disrupt the UI.
- final HandlerThread thread = new HandlerThread("MusicPlayerHandler",
+ mHandlerThread = new HandlerThread("MusicPlayerHandler",
android.os.Process.THREAD_PRIORITY_BACKGROUND);
- thread.start();
+ mHandlerThread.start();
// Initialize the handler
- mPlayerHandler = new MusicPlayerHandler(this, thread.getLooper());
+ mPlayerHandler = new MusicPlayerHandler(this, mHandlerThread.getLooper());
// Initialize the audio manager and register any headset controls for
// playback
// remove any pending alarms
mAlarmManager.cancel(mShutdownIntent);
+ // Remove any callbacks from the handler
+ mPlayerHandler.removeCallbacksAndMessages(null);
+ // quit the thread so that anything that gets posted won't run
+ mHandlerThread.quitSafely();
+
// Release the player
mPlayer.release();
mPlayer = null;
// remove the media store observer
getContentResolver().unregisterContentObserver(mMediaStoreObserver);
- // Remove any callbacks from the handler
- mPlayerHandler.removeCallbacksAndMessages(null);
-
// Close the cursor
closeCursor();