本文整理汇总了Java中org.holoeverywhere.app.AlertDialog.Builder类的典型用法代码示例。如果您正苦于以下问题:Java Builder类的具体用法?Java Builder怎么用?Java Builder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Builder类属于org.holoeverywhere.app.AlertDialog包,在下文中一共展示了Builder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onPrepareDialogBuilder
import org.holoeverywhere.app.AlertDialog.Builder; //导入依赖的package包/类
@Override
protected void onPrepareDialogBuilder(Builder builder) {
super.onPrepareDialogBuilder(builder);
if (mEntries == null || mEntryValues == null) {
throw new IllegalStateException(
"ListPreference requires an entries array and an entryValues array.");
}
mClickedDialogEntryIndex = getValueIndex();
builder.setSingleChoiceItems(mEntries, mClickedDialogEntryIndex,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mClickedDialogEntryIndex = which;
ListPreference.this.onClick(dialog,
DialogInterface.BUTTON_POSITIVE);
dialog.dismiss();
}
});
builder.setPositiveButton(null, null);
}
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:21,代码来源:ListPreference.java
示例2: alerter
import org.holoeverywhere.app.AlertDialog.Builder; //导入依赖的package包/类
public void alerter(String titre, String message) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
MapActivity.this);
// set title
alertDialogBuilder.setTitle(titre);
alertDialogBuilder.setIcon(R.drawable.ic_action_error);
// set dialog message
alertDialogBuilder.setMessage(message).setCancelable(true);
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:19,代码来源:MapActivity.java
示例3: create
import org.holoeverywhere.app.AlertDialog.Builder; //导入依赖的package包/类
public static Builder create (Context context, String title, String text) {
TextView message = new TextView(context);
message.setTextAppearance(context, android.R.style.TextAppearance_Medium);
float scale = context.getResources().getDisplayMetrics().density;
int dpAsPixels = (int) (8*scale + 0.5f);
message.setPadding(dpAsPixels, dpAsPixels, dpAsPixels, dpAsPixels);
Spanned s = Html.fromHtml(text);
if(Build.VERSION.SDK_INT != 16) { //Bug in 4.1 that causes Dialog to crash
message.setText(s);
message.setMovementMethod(LinkMovementMethod.getInstance());
} else {
message.setText(s.toString());
}
ScrollView scroll = new ScrollView(context);
scroll.addView(message);
return new AlertDialog.Builder(context)
.setTitle(title)
.setCancelable(true)
.setView(scroll);
}
开发者ID:johan12345,项目名称:ls-vertretungsplan,代码行数:24,代码来源:LinkAlertDialog.java
示例4: onPrepareDialogBuilder
import org.holoeverywhere.app.AlertDialog.Builder; //导入依赖的package包/类
@Override
protected void onPrepareDialogBuilder(Builder builder) {
super.onPrepareDialogBuilder(builder);
if (mEntries == null || mEntryValues == null) {
throw new IllegalStateException(
"MultiSelectListPreference requires an entries array and "
+ "an entryValues array.");
}
boolean[] checkedItems = getSelectedItems();
builder.setMultiChoiceItems(mEntries, checkedItems,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
if (isChecked) {
mPreferenceChanged |= mNewValues
.add(mEntryValues[which].toString());
} else {
mPreferenceChanged |= mNewValues
.remove(mEntryValues[which].toString());
}
}
});
mNewValues.clear();
mNewValues.addAll(mValues);
}
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:29,代码来源:MultiSelectListPreference.java
示例5: create
import org.holoeverywhere.app.AlertDialog.Builder; //导入依赖的package包/类
public _RingtonePickerDialog create() {
if (dialog != null) {
return this;
}
handler = new Handler();
hasDefaultItem = intent.getBooleanExtra(
RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
uriForDefaultItem = intent
.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI);
if (uriForDefaultItem == null) {
uriForDefaultItem = Settings.System.DEFAULT_RINGTONE_URI;
}
hasSilentItem = intent.getBooleanExtra(
RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);
ringtoneManager = new RingtoneManager(context);
final boolean includeDrm = intent.getBooleanExtra(
RingtoneManager.EXTRA_RINGTONE_INCLUDE_DRM, true);
ringtoneManager.setIncludeDrm(includeDrm);
int types = intent.getIntExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, -1);
if (types != -1) {
ringtoneManager.setType(types);
}
cursor = ringtoneManager.getCursor();
if (context instanceof Activity) {
((Activity) context).setVolumeControlStream(ringtoneManager
.inferStreamType());
}
existingUri = intent
.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI);
builder = new AlertDialog.Builder(context);
dialog = onCreateDialog(builder);
return this;
}
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:34,代码来源:_RingtonePickerDialog.java
示例6: onPrepareDialogBuilder
import org.holoeverywhere.app.AlertDialog.Builder; //导入依赖的package包/类
@Override
protected void onPrepareDialogBuilder(Builder builder) {
super.onPrepareDialogBuilder(builder);
if (mEntries == null || mEntryValues == null) {
throw new IllegalStateException(
"MultiSelectListPreference requires an entries array and "
+ "an entryValues array.");
}
boolean[] checkedItems = getSelectedItems();
builder.setMultiChoiceItems(mEntries, checkedItems,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
if (isChecked) {
mPreferenceChanged |= mNewValues
.add(mEntryValues[which].toString());
} else {
mPreferenceChanged |= mNewValues
.remove(mEntryValues[which].toString());
}
}
});
mNewValues.clear();
mNewValues.addAll(mValues);
}
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:29,代码来源:MultiSelectListPreference.java
示例7: onCreate
import org.holoeverywhere.app.AlertDialog.Builder; //导入依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.foursquare_setup_activity);
MenuActivity.hideLoader();
wv = (WebView) findViewById(R.id.webview);
ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog
.setTitle(getString(R.string.foursquare_setup_prepare_title));
progressDialog
.setMessage(getString(R.string.foursquare_setup_prepare_msg));
progressDialog.setCancelable(true);
progressDialog.setMax(5);
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
alertDialog
.setTitle(getString(R.string.foursquare_setup_failure_title))
.setMessage(getString(R.string.foursquare_setup_failure_msg))
.setNeutralButton(getString(R.string.ok),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
SetupActivity.this.finish();
}
});
new DownloadFoursquareSecretsTask(progressDialog, alertDialog)
.execute();
}
开发者ID:seawolf,项目名称:KeepingTracks,代码行数:34,代码来源:SetupActivity.java
示例8: DownloadFoursquareSecretsTask
import org.holoeverywhere.app.AlertDialog.Builder; //导入依赖的package包/类
public DownloadFoursquareSecretsTask(ProgressDialog dialogFromActivity,
Builder alertDialogFromActivity) {
progressDialog = dialogFromActivity;
alertDialog = alertDialogFromActivity;
}
开发者ID:seawolf,项目名称:KeepingTracks,代码行数:6,代码来源:SetupActivity.java
注:本文中的org.holoeverywhere.app.AlertDialog.Builder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论