Created
September 29, 2015 01:14
-
-
Save nanomader/ff70155cef9cb1feaa83 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| public void handleMessage(Message message) { | |
| //ExtendWeakRefHandler activity = mHandler.get(); | |
| if (message != null) { | |
| switch (message.what) { | |
| case TrackBrowser.DID_START: { | |
| Log.i(TAG, "Getting stored lyrics list..."); | |
| break; | |
| } | |
| case TrackBrowser.DID_SUCCEED: { | |
| Log.i(TAG, "Done."); | |
| if (mMenu != null) { | |
| MenuItem mi = mMenu.getItem(0); | |
| mi.setEnabled(true); | |
| } | |
| loadingDialog.dismiss(); | |
| break; | |
| } | |
| case TrackBrowser.ADD: { | |
| TrackBrowser.TrackView tv = (TrackBrowser.TrackView) message.obj; | |
| int index = Collections.binarySearch(mList, tv, mComparator); | |
| mList.add((index < 0) ? (-index - 1) : index, tv); | |
| la.notifyDataSetChanged(); | |
| break; | |
| } | |
| case TrackBrowser.DID_ERROR: { | |
| Exception e = (Exception) message.obj; | |
| // TODO: try e.toString() maybe it gives more detail about the error | |
| // Otherwise find a way to use printStackTrace() | |
| Log.e(TAG, "Error: " + e.getMessage()); | |
| loadingDialog.dismiss(); | |
| break; | |
| } | |
| case TrackBrowser.DID_INTERRUPT: { | |
| Log.w(TAG, "Lyric Browser interrupted"); | |
| break; | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment