List of usage examples for android.app Dialog setTitle
public void setTitle(@StringRes int titleId)
From source file:com.example.nestedarchetypeactivityexample.InnerArchetypeViewerActivity.java
/** * Show info dialog./*from w w w . j a va 2 s . c o m*/ * * @param content the content */ private void showInfoDialog(String content) { final Dialog dialog = new Dialog(this); dialog.setTitle("Json Adl Structure"); dialog.setContentView(R.layout.custom_dialog); TextView dialogText = (TextView) dialog.findViewById(R.id.dialogText); dialogText.setMovementMethod(new ScrollingMovementMethod()); dialogText.setText(content); Button dialogButton = (Button) dialog.findViewById(R.id.dialogButtonOK); dialogButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dialog.dismiss(); } }); dialog.show(); }
From source file:de.androvdr.activities.ChannelsActivity.java
@Override protected Dialog onCreateDialog(int id) { switch (id) { case DIALOG_WHATS_ON: final Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.extendedchannels_whats_on); dialog.setTitle(R.string.channels_whats_on); final SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); final DatePicker dp = (DatePicker) dialog.findViewById(R.id.channels_datePicker); final TimePicker tp = (TimePicker) dialog.findViewById(R.id.channels_timePicker); tp.setIs24HourView(DateFormat.is24HourFormat(getApplicationContext())); if (sp.contains("whats_on_hour")) { tp.setCurrentHour(sp.getInt("whats_on_hour", 0)); tp.setCurrentMinute(sp.getInt("whats_on_minute", 0)); }//from w ww. j a v a2 s. co m Button button = (Button) dialog.findViewById(R.id.channels_cancel); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dialog.dismiss(); } }); button = (Button) dialog.findViewById(R.id.channels_search); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Editor editor = sp.edit(); editor.putInt("whats_on_hour", tp.getCurrentHour()); editor.putInt("whats_on_minute", tp.getCurrentMinute()); editor.commit(); SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy hh:mm"); try { long time = df.parse(dp.getDayOfMonth() + "." + (dp.getMonth() + 1) + "." + dp.getYear() + " " + tp.getCurrentHour() + ":" + tp.getCurrentMinute()).getTime() / 1000; getController().whatsOn(time); } catch (ParseException e) { logger.error("Couldn't get date from pickers", e); } dialog.dismiss(); } }); return dialog; default: return super.onCreateDialog(id); } }
From source file:com.privacity.BuscarPerfilActivity.java
public void enviarCodigo(View view) { EditText txtv = (EditText) findViewById(R.id.editEnviarCodigo); String codigo = txtv.getText().toString(); JSONObject jsonObject = com.getPerfil(codigo); if (!jsonObject.has("Error") && !jsonObject.has("detail")) { try {//from ww w . j av a2 s . c om Intent intent = new Intent(this, PerfilActivity.class); intent.putExtra("descripcion", jsonObject.getString("descripcion")); intent.putExtra("permisos", jsonObject.getString("permisos")); Log.wtf("PERMISOS", jsonObject.getString("permisos")); intent.putExtra("usuario", jsonObject.getString("usuario")); intent.putExtra("codigo", codigo); intent.putExtra("agregado", jsonObject.getString("agregado")); startActivity(intent); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); Log.wtf("Error", e); } } //IF else { Dialog dialogoError = new Dialog(this); try { String error = jsonObject.getString("Error"); dialogoError.setTitle(error); } catch (JSONException e) { // TODO Auto-generated catch block dialogoError.setTitle(R.string.Upps); e.printStackTrace(); } dialogoError.show(); } }
From source file:com.sawyer.advadapters.app.dialogs.AddJSONArrayDialogFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = super.onCreateDialog(savedInstanceState); dialog.setContentView(R.layout.dialog_add_jsonarray); dialog.setTitle(R.string.title_dialog_add_movies); Button btn = (Button) dialog.findViewById(R.id.movie_single_btn); btn.setOnClickListener(new OnAddSingleClickListener()); TextView tv = (TextView) dialog.findViewById(R.id.movie_single_txt); tv.setText("- " + mMovieItems.optJSONObject(0).optString(MovieItem.JSON_TITLE)); btn = (Button) dialog.findViewById(R.id.movies_jsonarray_btn); btn.setOnClickListener(new OnAddJSONArrayClickListener()); tv = (TextView) dialog.findViewById(R.id.movie_multi_txt1); tv.setText("- " + mMovieItems.optJSONObject(1).optString(MovieItem.JSON_TITLE)); tv = (TextView) dialog.findViewById(R.id.movie_multi_txt2); tv.setText("- " + mMovieItems.optJSONObject(2).optString(MovieItem.JSON_TITLE)); btn = (Button) dialog.findViewById(R.id.movies_vararg_btn); btn.setOnClickListener(new OnAddVarargsClickListener()); btn.setVisibility(mIsArgvargsEnabled ? View.VISIBLE : View.GONE); return dialog; }
From source file:com.pileproject.drive.setting.app.ProgramListFragment.java
@Override @NonNull// w ww . j a va 2 s.c om public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = new Dialog(getActivity()); dialog.setTitle(R.string.setting_programList); return dialog; }
From source file:fr.cph.stock.android.activity.OverallActivity.java
private void showPanelUpdateHistory() { final Dialog alert = new Dialog(this); alert.setTitle("Update history"); alert.setContentView(R.layout.history_dialog); final Spinner checked = (Spinner) alert.findViewById(R.id.accountList); List<String> list = new ArrayList<String>(); for (Account acc : portfolio.getAccounts()) { list.add(acc.getName());/* ww w . j a v a 2 s . c o m*/ } ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); checked.setAdapter(dataAdapter); Button dialogButton = (Button) alert.findViewById(R.id.dialogButtonOK); dialogButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { refreshItem.setActionView(R.layout.progressbar); refreshItem.expandActionView(); Account account = portfolio.getAccounts().get(checked.getSelectedItemPosition()); EditText liquidityView = (EditText) alert.findViewById(R.id.liquidityMov); EditText yieldView = (EditText) alert.findViewById(R.id.yield); EditText buyView = (EditText) alert.findViewById(R.id.buy); EditText sellView = (EditText) alert.findViewById(R.id.sell); EditText taxeView = (EditText) alert.findViewById(R.id.taxe); EditText commentaryView = (EditText) alert.findViewById(R.id.commentaryEditText); String params = null; params = "?accountId=" + account.getId() + "&liquidity=" + liquidityView.getText() + "&yield=" + yieldView.getText() + "&buy=" + buyView.getText() + "&sell=" + sellView.getText() + "&taxe=" + taxeView.getText() + "&commentary=" + commentaryView.getText().toString().replaceAll(" ", "%20"); MainTask mainTask = new MainTask(OverallActivity.this, UrlType.UPDATEHISTORY, params); mainTask.execute((Void) null); alert.dismiss(); } }); dialogButton = (Button) alert.findViewById(R.id.dialogButtonCancel); dialogButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { alert.dismiss(); } }); alert.show(); }
From source file:im.vector.fragments.RoomMembersDialogFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog d = super.onCreateDialog(savedInstanceState); d.setTitle(getString(R.string.members_list)); return d;/*w ww . j a v a 2 s . com*/ }
From source file:com.example.energospolitis.ReportListActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case 1://from w w w.ja va2 s .co m final Dialog dialog = new Dialog(ReportListActivity.this); dialog.setContentView(R.layout.customdialog); dialog.setTitle(""); Button recent = (Button) dialog.findViewById(R.id.recbtn); recent.setText(""); Button type = (Button) dialog.findViewById(R.id.typebtn); type.setText(""); Button rate = (Button) dialog.findViewById(R.id.ratebtn); rate.setText(""); recent.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ReportList.sort("recent"); restart(); dialog.dismiss(); } }); rate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ReportList.sort("rate"); restart(); dialog.dismiss(); } }); type.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ReportList.sort("type"); dialog.dismiss(); } }); dialog.show(); break; default: return super.onOptionsItemSelected(item); } return true; }
From source file:com.privacity.PerfilActivity.java
public void agregarPerfil(View view) { JSONObject jsonObject = com.agregarPerfil(codigo); Dialog dialogo = new Dialog(this); //Tratamiento de errores if (jsonObject.has("Error")) { dialogo.setTitle(getResources().getString(R.string.errorDeConexion)); try {/*from w w w . ja va 2 s .c o m*/ String error = jsonObject.getString("Error"); dialogo.setTitle(error); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } //IF else { //Si ha tenido exito dialogo.setTitle(getResources().getString(R.string.perfilAgregado)); botonAceptar.setVisibility(View.INVISIBLE); botonCancelar.setVisibility(View.VISIBLE); } dialogo.show(); }
From source file:de.awisus.refugeeaidleipzig.views.profile.FragmentEditOffer.java
private void forNewOffer(Dialog dialog) { dialog.setTitle(R.string.titel_neues_angebot); }