Created
March 5, 2011 14:19
-
-
Save Eugeny/856378 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
private void showDialog() { | |
final AlertDialog dlg = new AlertDialog.Builder(this).setTitle( | |
R.string.pref_music_root).setMultiChoiceItems( | |
(String[]) mNames.toArray(new String[0]), mSelected, | |
new OnMultiChoiceClickListener() { | |
@Override | |
public void onClick(DialogInterface arg0, int arg1, boolean arg2) { | |
mSelected[arg1] = arg2; | |
} | |
}).setPositiveButton(android.R.string.ok, new OnClickListener() { | |
@Override | |
public void onClick(DialogInterface arg0, int arg1) { | |
for (boolean b : mSelected) | |
if (b) { | |
String r = ""; | |
for (int i = 0; i < mSelected.length; i++) | |
if (mSelected[i]) | |
r += ";" + mPaths.get(i); | |
r = r.substring(1); | |
Util.getPreference(FirstRunActivity.this).edit() | |
.putString("music_root", r).commit(); | |
PlayerClient.bind(FirstRunActivity.this); | |
return; | |
} | |
FirstRunActivity.this.runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
showDialog(); | |
} | |
}); | |
} | |
}).create(); | |
dlg.show(); | |
Util.checkLicense(this, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment