use of android.content.DialogInterface in project AnimeTaste by daimajia.
the class LoadActivity method onCreate.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
google_bug();
ActiveAndroid.setLoggingEnabled(false);
ShareSDK.initSDK(mContext);
updateFromOldVersion();
setContentView(R.layout.activity_load);
MobclickAgent.onError(this);
if (PreferenceManager.getDefaultSharedPreferences(mContext).getBoolean("only_wifi", true) && !NetworkUtils.isWifiConnected(mContext)) {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext).setTitle(R.string.only_wifi_title).setMessage(R.string.only_wifi_body);
builder.setCancelable(false);
builder.setPositiveButton(R.string.only_wifi_ok, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
init();
}
});
builder.setNegativeButton(R.string.only_wifi_cancel, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
builder.create().show();
} else {
init();
}
}
use of android.content.DialogInterface in project AnimeTaste by daimajia.
the class FavoriteActivity method onItemLongClick.
@Override
public boolean onItemLongClick(AdapterView<?> parent, View item, int position, long id) {
final Animation animation = (Animation) mFavListAdapter.getItem(position);
AlertDialog.Builder builder = new AlertDialog.Builder(mContext).setTitle(R.string.delete_title).setMessage(R.string.delete_body).setNegativeButton(R.string.delete_cancel, null).setPositiveButton(R.string.delete_ok, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
animation.removeFromFavorite(new Animation.UpdateFinishCallback() {
@Override
public void onUpdateFinished(Animation.Method method, Message msg) {
new LoadAsyncTask().execute();
}
});
Toast.makeText(mContext, R.string.delete_success, Toast.LENGTH_SHORT).show();
}
});
builder.create().show();
return false;
}
use of android.content.DialogInterface in project UltimateAndroid by cymcsg.
the class DialogShower method showNoticeDialog.
public void showNoticeDialog(String alertInfo, final Thread thread) {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setTitle(noticeTitle);
builder.setMessage(alertInfo);
builder.setPositiveButton(positiveButtonString, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
showDownloadDialog();
thread.start();
}
});
builder.setNegativeButton(negativeButtonString, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
AlertDialog noticeDialog = builder.create();
// noticeDialog.setContentView(v);
WindowManager.LayoutParams lp = noticeDialog.getWindow().getAttributes();
lp.height = 200;
noticeDialog.getWindow().setAttributes(lp);
noticeDialog.setCancelable(false);
noticeDialog.show();
}
use of android.content.DialogInterface in project UltimateAndroid by cymcsg.
the class DownloadDialogShower method showNoticeDialog.
public void showNoticeDialog(String alertInfo, final Thread thread) {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setTitle(noticeTitle);
builder.setMessage(alertInfo);
builder.setPositiveButton(positiveButtonString, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
showDownloadDialog();
thread.start();
}
});
builder.setNegativeButton(negativeButtonString, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
AlertDialog noticeDialog = builder.create();
// noticeDialog.setContentView(v);
WindowManager.LayoutParams lp = noticeDialog.getWindow().getAttributes();
lp.height = 200;
noticeDialog.getWindow().setAttributes(lp);
noticeDialog.setCancelable(false);
noticeDialog.show();
}
use of android.content.DialogInterface in project UltimateAndroid by cymcsg.
the class DownloadDialogShower method showDownloadDialog.
private void showDownloadDialog() {
builder = new AlertDialog.Builder(mContext);
final LayoutInflater inflater = LayoutInflater.from(mContext);
View v = inflater.inflate(R.layout.progress_update, null);
mProgress = (ProgressBar) v.findViewById(R.id.progress);
updatePercentTextView = (TextView) v.findViewById(R.id.updatePercentTextView);
updateCurrentTextView = (TextView) v.findViewById(R.id.updateCurrentTextView);
updateCurrentTextView.setText(prepareDownloadingTextViewString);
updateTotalTextView = (TextView) v.findViewById(R.id.updateTotalTextView);
// builder.setCustomTitle(inflater.inflate(R.layout.progress_update_title, null));
builder.setTitle(downloadTitle);
builder.setView(v);
builder.setNegativeButton(downloadCancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
interceptFlag = true;
}
});
progressDialog = builder.create();
progressDialog.show();
}
Aggregations