Skip to content

Instantly share code, notes, and snippets.

@Eugeny
Created March 5, 2011 14:19
Show Gist options
  • Save Eugeny/856378 to your computer and use it in GitHub Desktop.
Save Eugeny/856378 to your computer and use it in GitHub Desktop.
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