List of usage examples for android.app Dialog Dialog
public Dialog(@NonNull Context context, @StyleRes int themeResId)
From source file:com.inter.trade.ui.fragment.smsreceivepayment.SmsReceivePaymentMainFragment.java
/** * ??//from w ww .j a va 2 s. c om * @param message * @param positive * @param negative * @param positiveEnable * @param negativeEnable */ private void showDefaultCardDialog(String message, String positive, String negative, boolean positiveEnable, boolean negativeEnable) { message = "??????????"; //newDialog? Dialog dialog = new Dialog(getActivity(), R.style.MyDialogStyleBottom); //ContentView dialog.setContentView(R.layout.sms_default_card_dialog); dialog.findViewById(R.id.select_card).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub selectReceiveBankCard(); } }); dialog.findViewById(R.id.add_card).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub addReceiveBankCard(); } }); dialog.findViewById(R.id.select_card).setEnabled(positiveEnable); dialog.findViewById(R.id.add_card).setEnabled(negativeEnable); dialog.setCancelable(true); dialog.setCanceledOnTouchOutside(true); dialog.show(); }
From source file:info.hl.mediam.MyProfileActivity.java
@Override protected Dialog onCreateDialog(int id) { switch (id) { case GET_IMAGE_DIALOG: mGetImageDialog = new Dialog(MyProfileActivity.this, R.style.TransparentDialogTheme); mGetImageDialog.getWindow().setGravity(Gravity.BOTTOM); mGetImageDialog.setContentView(R.layout.dialog_get_image); WindowManager.LayoutParams params = new WindowManager.LayoutParams(); Window window = mGetImageDialog.getWindow(); params.copyFrom(window.getAttributes()); params.width = WindowManager.LayoutParams.MATCH_PARENT; params.height = WindowManager.LayoutParams.WRAP_CONTENT; window.setAttributes(params);/*w w w.j av a 2 s. c om*/ final Button btnGallery = (Button) mGetImageDialog.findViewById(R.id.btnGallery); btnGallery.setTypeface(MediamApp.getTfMyriadProBold(), Typeface.BOLD); btnGallery.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent galleryIntent = new Intent(MyProfileActivity.this, CameraCropActivity.class); galleryIntent.putExtra("type", "gallery"); galleryIntent.putExtra("profile", true); MyProfileActivity.this.startActivityForResult(galleryIntent, UPDATE_IMAGE_REQUEST_CODE); mGetImageDialog.dismiss(); } }); final Button btnCamera = (Button) mGetImageDialog.findViewById(R.id.btnCamera); btnCamera.setTypeface(MediamApp.getTfMyriadProBold(), Typeface.BOLD); btnCamera.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent cameraIntent = new Intent(MyProfileActivity.this, CameraCropActivity.class); cameraIntent.putExtra("type", "camera"); cameraIntent.putExtra("profile", true); MyProfileActivity.this.startActivityForResult(cameraIntent, UPDATE_IMAGE_REQUEST_CODE); mGetImageDialog.dismiss(); } }); final Button btnRemovePhoto = (Button) mGetImageDialog.findViewById(R.id.btnRemovePhoto); btnRemovePhoto.setTypeface(MediamApp.getTfMyriadProBold(), Typeface.BOLD); btnRemovePhoto.setOnClickListener(new OnClickListener() { public void onClick(View v) { mNewAvatarId = ""; gProfileImage = null; Utils.displayImage(mNewAvatarId, mIvProfileImage, mPbLoading, ImageLoader.LARGE, R.drawable.user_stub_large, false); mGetImageDialog.dismiss(); } }); return mGetImageDialog; case GET_BIRTHDAY_DIALOG: int intMaxYear = Calendar.getInstance().get(Calendar.YEAR); int intMaxMonth = Calendar.getInstance().get(Calendar.MONTH); int intMaxDay = Calendar.getInstance().get(Calendar.DAY_OF_MONTH); mGetBirthdayDialog = new DatePickerDialogWithRange(this, new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { Time chosenDate = new Time(); chosenDate.set(dayOfMonth, monthOfYear, year); mNewBirthday = chosenDate.toMillis(true) / 1000; CharSequence stringDate = DateFormat.format(getString(R.string.hookup_date_format), chosenDate.toMillis(true)); mEtUserBirthday.setText(stringDate.toString()); } }, intMaxYear, intMaxMonth, intMaxDay); mGetBirthdayDialog.setMessage(getString(R.string.when_is_your_birthday)); return mGetBirthdayDialog; default: return null; } }
From source file:com.cloverstudio.spika.MyProfileActivity.java
@Override protected Dialog onCreateDialog(int id) { switch (id) { case GET_IMAGE_DIALOG: mGetImageDialog = new Dialog(MyProfileActivity.this, R.style.TransparentDialogTheme); mGetImageDialog.getWindow().setGravity(Gravity.BOTTOM); mGetImageDialog.setContentView(R.layout.dialog_get_image); WindowManager.LayoutParams params = new WindowManager.LayoutParams(); Window window = mGetImageDialog.getWindow(); params.copyFrom(window.getAttributes()); params.width = WindowManager.LayoutParams.MATCH_PARENT; params.height = WindowManager.LayoutParams.WRAP_CONTENT; window.setAttributes(params);/*from w w w. j a v a 2 s . c o m*/ final Button btnGallery = (Button) mGetImageDialog.findViewById(R.id.btnGallery); btnGallery.setTypeface(SpikaApp.getTfMyriadProBold(), Typeface.BOLD); btnGallery.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent galleryIntent = new Intent(MyProfileActivity.this, CameraCropActivity.class); galleryIntent.putExtra("type", "gallery"); galleryIntent.putExtra("profile", true); MyProfileActivity.this.startActivityForResult(galleryIntent, UPDATE_IMAGE_REQUEST_CODE); mGetImageDialog.dismiss(); } }); final Button btnCamera = (Button) mGetImageDialog.findViewById(R.id.btnCamera); btnCamera.setTypeface(SpikaApp.getTfMyriadProBold(), Typeface.BOLD); btnCamera.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent cameraIntent = new Intent(MyProfileActivity.this, CameraCropActivity.class); cameraIntent.putExtra("type", "camera"); cameraIntent.putExtra("profile", true); MyProfileActivity.this.startActivityForResult(cameraIntent, UPDATE_IMAGE_REQUEST_CODE); mGetImageDialog.dismiss(); } }); final Button btnRemovePhoto = (Button) mGetImageDialog.findViewById(R.id.btnRemovePhoto); btnRemovePhoto.setTypeface(SpikaApp.getTfMyriadProBold(), Typeface.BOLD); btnRemovePhoto.setOnClickListener(new OnClickListener() { public void onClick(View v) { mNewAvatarId = ""; gProfileImage = null; Utils.displayImage(mNewAvatarId, mIvProfileImage, mPbLoading, ImageLoader.LARGE, R.drawable.user_stub_large, false); mGetImageDialog.dismiss(); } }); return mGetImageDialog; case GET_BIRTHDAY_DIALOG: int intMaxYear = Calendar.getInstance().get(Calendar.YEAR); int intMaxMonth = Calendar.getInstance().get(Calendar.MONTH); int intMaxDay = Calendar.getInstance().get(Calendar.DAY_OF_MONTH); mGetBirthdayDialog = new DatePickerDialogWithRange(this, new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { Time chosenDate = new Time(); chosenDate.set(dayOfMonth, monthOfYear, year); mNewBirthday = chosenDate.toMillis(true) / 1000; CharSequence stringDate = DateFormat.format(getString(R.string.hookup_date_format), chosenDate.toMillis(true)); mEtUserBirthday.setText(stringDate.toString()); } }, intMaxYear, intMaxMonth, intMaxDay); mGetBirthdayDialog.setMessage(getString(R.string.when_is_your_birthday)); return mGetBirthdayDialog; default: return null; } }
From source file:com.thingsee.tracker.MainActivity.java
public void onClickShowLogin(View v) { loginCredentials = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen); loginCredentials.requestWindowFeature(Window.FEATURE_NO_TITLE); loginCredentials.setCancelable(true); loginCredentials.setContentView(R.layout.login_credentials); final EditText usernameInput = (EditText) loginCredentials.findViewById(R.id.username); final EditText passwordInput = (EditText) loginCredentials.findViewById(R.id.password); if (mPrepopulateLogin) { String userName = mSettings.getString("Username", null); String passWord = mSettings.getString("Password", null); if ((userName != null) && (passWord != null)) { usernameInput.setText(userName); passwordInput.setText(passWord); }/*w w w . ja v a 2 s .c o m*/ } ClearTextView login = (ClearTextView) loginCredentials.findViewById(R.id.login); login.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { String username = usernameInput.getText().toString(); String password = passwordInput.getText().toString(); InputMethodManager imm = (InputMethodManager) mContext .getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getWindow().getDecorView().getRootView().getWindowToken(), 0); loginUser(username, password, false); } }); loginCredentials.show(); }
From source file:com.todoroo.astrid.activity.TaskEditFragment.java
private void constructWhenDialog(View whenDialogView) { int theme = ThemeService.getEditDialogTheme(); whenDialog = new Dialog(getActivity(), theme); Button dismissDialogButton = (Button) whenDialogView.findViewById(R.id.when_dismiss); dismissDialogButton.setOnClickListener(new View.OnClickListener() { @Override/*from w ww . ja v a 2 s . c om*/ public void onClick(View v) { DialogUtilities.dismissDialog(getActivity(), whenDialog); } }); DisplayMetrics metrics = new DisplayMetrics(); getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics); whenDialog.setTitle(R.string.TEA_when_dialog_title); whenDialog.addContentView(whenDialogView, new LayoutParams(metrics.widthPixels - (int) (30 * metrics.density), LayoutParams.WRAP_CONTENT)); }
From source file:com.alivenet.dmv.driverapplication.fragment.MyAccount.java
public void showActionSheet() { LayoutInflater inflater = LayoutInflater.from(getActivity()); final Dialog myDialog = new Dialog(getActivity(), android.R.style.Theme_Translucent_NoTitleBar); myDialog.setCanceledOnTouchOutside(true); myDialog.getWindow().setLayout(AbsoluteLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); myDialog.getWindow().setGravity(Gravity.BOTTOM); myDialog.getWindow().getAttributes().windowAnimations = R.anim.slide_up; WindowManager.LayoutParams lp = myDialog.getWindow().getAttributes(); lp.dimAmount = 0.75f;/*w w w . ja va2 s.com*/ myDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); myDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); myDialog.getWindow(); View dialoglayout = inflater.inflate(R.layout.dialog_profile_actionsheet, null); myDialog.setContentView(dialoglayout); TextView mTvTakeFromCamera = (TextView) myDialog.findViewById(R.id.tvTakeFromCamera); TextView mTvTakeFromLibrary = (TextView) myDialog.findViewById(R.id.tvTakeFromLibrary); long timestamp = System.currentTimeMillis(); AppData.getSingletonObject().setmFileTemp(getActivity(), "" + timestamp); mTvTakeFromCamera.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { myDialog.dismiss(); takePicture(getActivity()); } }); mTvTakeFromLibrary.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { myDialog.dismiss(); openGallery(getActivity()); } }); TextView tvCancel = (TextView) myDialog.findViewById(R.id.tvCancel); tvCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { myDialog.dismiss(); } }); try { myDialog.show(); } catch (WindowManager.BadTokenException e) { Log.e("", "View not attached."); } catch (Exception e) { e.printStackTrace(); } }
From source file:edu.pitt.gis.uniapp.UniApp.java
/** * Shows the splash screen over the full Activity *//* w w w . ja v a 2 s .c o m*/ @SuppressWarnings("deprecation") protected void showSplashScreen(final int time) { final UniApp that = this; Runnable runnable = new Runnable() { public void run() { // Get reference to display Display display = getWindowManager().getDefaultDisplay(); // Create the layout for the dialog LinearLayout root = new LinearLayout(that.getActivity()); root.setMinimumHeight(display.getHeight()); root.setMinimumWidth(display.getWidth()); root.setOrientation(LinearLayout.VERTICAL); root.setBackgroundColor(that.getIntegerProperty("backgroundColor", Color.BLACK)); root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 0.0F)); root.setBackgroundResource(that.splashscreen); // Create and show the dialog splashDialog = new Dialog(that, android.R.style.Theme_Translucent_NoTitleBar); // check to see if the splash screen should be full screen if ((getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == WindowManager.LayoutParams.FLAG_FULLSCREEN) { splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } splashDialog.setContentView(root); splashDialog.setCancelable(false); splashDialog.show(); // Set Runnable to remove splash screen just in case final Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { removeSplashScreen(); } }, time); } }; this.runOnUiThread(runnable); }
From source file:com.gpsmobitrack.gpstracker.MenuItems.SettingsPage.java
/** * Show frequency dialog/*from ww w.j av a 2s . c o m*/ */ private void showFrequencyPurchaseDialog(final int value) { final Dialog dialog = new Dialog(getActivity(), android.R.style.Theme_Translucent); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setCancelable(false); dialog.setContentView(R.layout.alert_dialog_main); final TextView alertTitle = (TextView) dialog.findViewById(R.id.alert_title); final TextView alertMsg = (TextView) dialog.findViewById(R.id.alert_msg); final EditText alertEditTxt = (EditText) dialog.findViewById(R.id.alert_edit_txt); Button okBtn = (Button) dialog.findViewById(R.id.alert_ok_btn); Button cancelBtn = (Button) dialog.findViewById(R.id.alert_cancel_btn); final RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.myRadioGroup); final RadioButton radioOneMonth = (RadioButton) dialog.findViewById(R.id.oneMonth); final RadioButton radioThreeMonth = (RadioButton) dialog.findViewById(R.id.threeMonth); final RadioButton radioSixMonth = (RadioButton) dialog.findViewById(R.id.sixMonth); final RadioButton radioOneYear = (RadioButton) dialog.findViewById(R.id.oneYear); //long updateTime = pref.getLong(AppConstants.FREQ_UPDATE_PREF, AppConstants.DEFAULT_TIME_INTERVAL); radioGroup.setVisibility(View.VISIBLE); alertTitle.setText("Purchase Product"); if (value == updateDurationValue[0]) { alertMsg.setText("Buy Update Frequency for 1 Minutes"); //radioOneMonth.setChecked(true); if (userType == PurchaseStatus.FULL_ACCESS_USER) { if (duration.equalsIgnoreCase("OneMonth")) { radioOneMonth.setChecked(true); } else { radioOneMonth.setChecked(false); ; } if (duration.equalsIgnoreCase("ThreeMonth")) { radioThreeMonth.setChecked(true); } else { radioThreeMonth.setChecked(false); } if (duration.equalsIgnoreCase("SixMonth")) { radioSixMonth.setChecked(true); } else { radioSixMonth.setChecked(false); } if (duration.equalsIgnoreCase("OneYear")) { radioOneYear.setChecked(true); } else { radioOneYear.setChecked(false); } } } else if (value == updateDurationValue[1]) { alertMsg.setText("Buy Update Frequency for 2 Minutes"); if (userType == PurchaseStatus.SEMI_FULL_ACCESS_USER) { if (duration.equalsIgnoreCase("OneMonth")) { radioOneMonth.setChecked(true); } else { radioOneMonth.setChecked(false); ; } if (duration.equalsIgnoreCase("ThreeMonth")) { radioThreeMonth.setChecked(true); } else { radioThreeMonth.setChecked(false); } if (duration.equalsIgnoreCase("SixMonth")) { radioSixMonth.setChecked(true); } else { radioSixMonth.setChecked(false); } if (duration.equalsIgnoreCase("OneYear")) { radioOneYear.setChecked(true); } else { radioOneYear.setChecked(false); } } } else if (value == updateDurationValue[2]) { alertMsg.setText("Buy Update Frequency for 3 Minutes"); if (userType == PurchaseStatus.PARTIAL_ACCESS_USER) { if (duration.equalsIgnoreCase("OneMonth")) { radioOneMonth.setChecked(true); } else { radioOneMonth.setChecked(false); ; } if (duration.equalsIgnoreCase("ThreeMonth")) { radioThreeMonth.setChecked(true); } else { radioThreeMonth.setChecked(false); } if (duration.equalsIgnoreCase("SixMonth")) { radioSixMonth.setChecked(true); } else { radioSixMonth.setChecked(false); } if (duration.equalsIgnoreCase("OneYear")) { radioOneYear.setChecked(true); } else { radioOneYear.setChecked(false); } } } alertEditTxt.setVisibility(View.GONE); radioOneMonth.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (value == updateDurationValue[0]) { purchaseClicked = PurchaseClicked.ONE_MIN_ONE_MONTH; } else if (value == updateDurationValue[1]) { purchaseClicked = PurchaseClicked.TWO_MIN_ONE_MONTH; } else if (value == updateDurationValue[2]) { purchaseClicked = PurchaseClicked.THREE_MIN_ONE_MONTH; } } }); radioThreeMonth.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (value == updateDurationValue[0]) { purchaseClicked = PurchaseClicked.ONE_MIN_THREE_MONTH; } else if (value == updateDurationValue[1]) { purchaseClicked = PurchaseClicked.TWO_MIN_THREE_MONTH; } else if (value == updateDurationValue[2]) { purchaseClicked = PurchaseClicked.THREE_MIN_THREE_MONTH; } } }); radioSixMonth.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (value == updateDurationValue[0]) { purchaseClicked = PurchaseClicked.ONE_MIN_SIX_MONTH; } else if (value == updateDurationValue[1]) { purchaseClicked = PurchaseClicked.TWO_MIN_SIX_MONTH; } else if (value == updateDurationValue[2]) { purchaseClicked = PurchaseClicked.THREE_MIN_SIX_MONTH; } } }); radioOneYear.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (value == updateDurationValue[0]) { purchaseClicked = PurchaseClicked.ONE_MIN_ONE_YEAR; } else if (value == updateDurationValue[1]) { purchaseClicked = PurchaseClicked.TWO_MIN_ONE_YEAR; } else if (value == updateDurationValue[2]) { purchaseClicked = PurchaseClicked.THREE_MIN_ONE_YEAR; } } }); cancelBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dialog.dismiss(); long updateTime = pref.getLong(AppConstants.FREQ_UPDATE_PREF, AppConstants.DEFAULT_TIME_INTERVAL); // Set Spinner setSpinnerUpdateTime(updateTime); firstSelect = false; } }); okBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (radioOneMonth.isChecked() || radioThreeMonth.isChecked() || radioSixMonth.isChecked() || radioOneYear.isChecked()) { // One min update if (value == updateDurationValue[0] && radioOneMonth.isChecked()) { fullPurchaseOneMonth(); purchaseClicked = PurchaseClicked.ONE_MIN_ONE_MONTH; //startUpdatePurchaseStatus(); } else if (value == updateDurationValue[0] && radioThreeMonth.isChecked()) { fullPurchaseThreeMonth(); purchaseClicked = PurchaseClicked.ONE_MIN_THREE_MONTH; //startUpdatePurchaseStatus(); } else if (value == updateDurationValue[0] && radioSixMonth.isChecked()) { fullPurchaseSixMonth(); purchaseClicked = PurchaseClicked.ONE_MIN_SIX_MONTH; //startUpdatePurchaseStatus(); } else if (value == updateDurationValue[0] && radioOneYear.isChecked()) { fullPurchaseOneYear(); purchaseClicked = PurchaseClicked.ONE_MIN_ONE_YEAR; //startUpdatePurchaseStatus(); } // Two min update else if (value == updateDurationValue[1] && radioOneMonth.isChecked()) { semiparticalPurchaseOneMonth(); purchaseClicked = PurchaseClicked.TWO_MIN_ONE_MONTH; //startUpdatePurchaseStatus(); } else if (value == updateDurationValue[1] && radioThreeMonth.isChecked()) { semiparticalPurchaseThreeMonth(); purchaseClicked = PurchaseClicked.TWO_MIN_THREE_MONTH; //startUpdatePurchaseStatus(); } else if (value == updateDurationValue[1] && radioSixMonth.isChecked()) { semiparticalPurchaseSixMonth(); purchaseClicked = PurchaseClicked.TWO_MIN_SIX_MONTH; //startUpdatePurchaseStatus(); } else if (value == updateDurationValue[1] && radioOneYear.isChecked()) { semiparticalPurchaseOneYear(); purchaseClicked = PurchaseClicked.TWO_MIN_ONE_YEAR; //startUpdatePurchaseStatus(); } // Three min update else if (value == updateDurationValue[2] && radioOneMonth.isChecked()) { particalPurchaseOneMonth(); purchaseClicked = PurchaseClicked.THREE_MIN_ONE_MONTH; //startUpdatePurchaseStatus(); } else if (value == updateDurationValue[2] && radioThreeMonth.isChecked()) { particalPurchaseThreeMonth(); purchaseClicked = PurchaseClicked.THREE_MIN_THREE_MONTH; //startUpdatePurchaseStatus(); } else if (value == updateDurationValue[2] && radioSixMonth.isChecked()) { particalPurchaseSixMonth(); purchaseClicked = PurchaseClicked.THREE_MIN_SIX_MONTH; //startUpdatePurchaseStatus(); } else if (value == updateDurationValue[2] && radioOneYear.isChecked()) { particalPurchaseOneYear(); purchaseClicked = PurchaseClicked.THREE_MIN_ONE_YEAR; //startUpdatePurchaseStatus(); } long updateTime = pref.getLong(AppConstants.FREQ_UPDATE_PREF, AppConstants.DEFAULT_TIME_INTERVAL); // Set Spinner setSpinnerUpdateTime(updateTime); firstSelect = false; dialog.dismiss(); } else { dialog.show(); Utils.showToast("Select durations"); //Toast.makeText(getActivity(), "Select durations", Toast.LENGTH_LONG).show(); } } }); dialog.show(); }
From source file:com.paic.zhifu.wallet.activity.modules.register.PhoneValidationActivity.java
public void showLoginDialog() { LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.dialog_register, (ViewGroup) findViewById(R.id.dialog_smsdialog)); dialog_phonenum = (TextView) layout.findViewById(R.id.txt_title_smsdialog); btn_dialoglogin = (Button) layout.findViewById(R.id.btn_login_smsdialog); btn_dialogcancel = (Button) layout.findViewById(R.id.btn_cancel_smsdialog); logindialog = new Dialog(PhoneValidationActivity.this, R.style.Register_Dialog); logindialog.setCanceledOnTouchOutside(false); logindialog.setContentView(layout);//from w ww . ja v a 2 s .co m dialog_phonenum.setText(getResources().getString(R.string.txt_prompt_register) + loginId + getResources().getString(R.string.txt_promptlast_register)); logindialog.show(); btn_dialoglogin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = null; if (FromActivity != null) { intent = new Intent(PhoneValidationActivity.this, LoginActivity.class); } else { intent = new Intent(PhoneValidationActivity.this, LoginActivity3.class); } intent.putExtra(RESULT_LONGIN_ID_KEY, loginId); startActivity(intent); RegisterDataCache.getDataCache().setPhoneValidationActivity(null); RegisterDataCache.getDataCache().cleanRuningActivitys(); } }); btn_dialogcancel.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { logindialog.dismiss(); } }); }
From source file:com.allwinner.theatreplayer.launcher.activity.LaunchActivity.java
public void openDialog() { // Dialog dialog = null; // Builder builder = new Dialog.Builder(this).setTitle("?").setMessage("??"); // dialog = builder.create(); // dialog.show(); Dialog dialog = new Dialog(this, R.style.CustomDialog); dialog.setContentView(R.layout.launcher_fail); dialog.setOnKeyListener(keylistener); dialog.setCanceledOnTouchOutside(false); dialog.setCancelable(false);//from w ww . j a v a2s . com dialog.show(); }