List of usage examples for android.app AlertDialog setTitle
@Override public void setTitle(CharSequence title)
From source file:com.aikidonord.fragments.FragmentType.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_type, null /*container, false*/); View rlLoading = view.findViewById(R.id.loadingPanel); //View listView = view.getListView(); if (VerifConnexion.isOnline(this.getActivity())) { rlLoading.setVisibility(View.VISIBLE); // on va fair l'impasse l dessus vu que je ne suis pas bien sr // de la manire dont il faut oprer tant que la vue n'a pas t renvoye. //listView.setVisibility(View.GONE); this.lancementAsync(); } else {/* w w w .ja va 2 s . c o m*/ AlertDialog alertDialog = new AlertDialog.Builder(this.getActivity()).create(); alertDialog.setTitle(getResources().getString(R.string.app_name)); alertDialog.setMessage(getResources().getString(R.string.no_network)); alertDialog.setIcon(R.drawable.ic_launcher); alertDialog.setCancelable(false); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getResources().getString(R.string.close), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // if this button is clicked, close // current activity FragmentType.this.getActivity().finish(); } }); alertDialog.show(); } return view; }
From source file:com.clearcenter.mobile_demo.mdMainActivity.java
public void onCreate(Bundle bundle) { Log.i(TAG, "onCreate(" + bundle + ")"); super.onCreate(bundle); setContentView(R.layout.main_activity); Log.i(TAG, "loading data from Intent"); final Intent intent = getIntent(); Log.i(TAG, "onCreate intent: " + intent); final Bundle extras = getIntent().getExtras(); Log.i(TAG, "onCreate intent extras: " + extras); accounts_textview = (TextView) findViewById(R.id.accounts_textview); accounts_listview = (ListView) findViewById(R.id.accounts_listview); accounts_adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1); accounts_listview.setAdapter(accounts_adapter); accounts_listview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (position == 0) { final Intent intent = new Intent(mdMainActivity.this, mdAuthenticatorActivity.class); mdMainActivity.this.startActivity(intent); //new Intent(android.provider.Settings.ACTION_ADD_ACCOUNT), 0); } else { final Intent intent = new Intent(mdMainActivity.this, mdStatusActivity.class); intent.putExtra("nickname", mdMainActivity.this.accounts_adapter.getItem(position)); mdMainActivity.this.startActivity(intent); }//from www . j a v a2s. co m } }); accounts_listview.setOnItemLongClickListener(new OnItemLongClickListener() { public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { if (position == 0) return false; final String nickname = mdMainActivity.this.accounts_adapter.getItem(position); mdMainActivity.this.account_to_delete = nickname; AlertDialog alert_dialog = new AlertDialog.Builder(mdMainActivity.this).create(); //alert_dialog.setIcon(R.drawable.ic_launcher); alert_dialog.setTitle("Remove System?"); alert_dialog.setMessage("Are you sure you want to remove the " + nickname + " system account?"); alert_dialog.setButton(DialogInterface.BUTTON_POSITIVE, "Remove system", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { mdMainActivity.this.onRemoveAccount(); } }); alert_dialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alert_dialog.show(); return true; } }); account_manager = AccountManager.get(this); }
From source file:markson.visuals.sitapp.CCActivity.java
@SuppressWarnings("deprecation") public void download() { AlertDialog alertDialog = new AlertDialog.Builder(CCActivity.this).create(); alertDialog.setTitle(cclass); alertDialog.setMessage("Class: " + num + "\n" + "Professor: " + instructor + "\n" + "Time: " + time + "\n" + "Date: " + date + "\n" + "CRN: " + crn + "\n"); alertDialog.setButton("Close", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss();/*from ww w . j av a2 s . co m*/ } }); alertDialog.show(); }
From source file:com.metinkale.prayerapp.vakit.fragments.SortFragment.java
public void onItemDismiss(final int position) { final Times times = Times.getTimesAt(position); AlertDialog dialog = new AlertDialog.Builder(getActivity()).create(); dialog.setTitle(R.string.delete); dialog.setMessage(getString(R.string.delConfirm, times.getName())); dialog.setCancelable(false);/*from w w w .j a va2 s.com*/ dialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.yes), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int buttonId) { times.delete(); mAdapter.notifyItemRemoved(position); } }); dialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.no), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int buttonId) { dialog.cancel(); mAdapter.notifyDataSetChanged(); } }); dialog.show(); }
From source file:bikebadger.RideActivity.java
@Override public void onCreate(Bundle savedInstanceState) { Log.d("Bike Badger", "RideActivity::onCreate"); super.onCreate(savedInstanceState); Context context = getApplicationContext(); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); AppManager.AppStartEnum startMode = AppManager.CheckAppStart(getApplicationContext(), preferences); //startMode = AppManager.AppStartEnum.EXPIRED_FREE; //startMode = AppManager.AppStartEnum.DISABLED; switch (startMode) { case DISABLED: AlertDialog finishAlert = new AlertDialog.Builder(this).create(); finishAlert.setCancelable(false); finishAlert.setTitle("Trial Expired"); finishAlert.setMessage("Your trial has expired. Please consider purchasing the full version."); finishAlert.setButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { //RideManager rm = RideManager.get(RideActivity.this); //if(rm != null) // rm.Shutdown(); RideActivity.this.finish(); //dialog.dismiss(); }/*w ww . j a v a2 s.c o m*/ }); finishAlert.show(); break; case EXPIRED_FREE: // expired trail. Let them purchase or do nothing. AppManager.PurchaseDialog(this); break; case NORMAL_FREE: // Still counting down the expiry. Do nothing break; case NORMAL_PAID: // TODO Until I figure out what this overly complicated thing does, don't use it // If it is merely to prevent folks from side-loading a copy they somehow get a hold of, they // deserve a free version // checkLicense(); // all is well. Do nothing break; case FIRST_TIME_FREE: // the version number ends in .free AppManager.CopyAssetFileOrDir("empty.gpx", context); AppManager.CopyAssetFileOrDir("EnchiladaBuffet_Austin.gpx", context); AppManager.CopyAssetFileOrDir("BikeBadger.pdf", context); // conditional shows the version notes (only if the version has changed) VersionNotes myNotes = new VersionNotes(this); myNotes.showVersionNotes(); break; case FIRST_TIME_PAID: AppManager.CopyAssetFileOrDir("empty.gpx", context); AppManager.CopyAssetFileOrDir("EnchiladaBuffet_Austin.gpx", context); AppManager.CopyAssetFileOrDir("BikeBadger.pdf", context); // TODO Until I figure out what this overly complicated thing does, don't use it // If it is merely to prevent folks from side-loading a copy they somehow get a hold of, they // deserve a free version // checkLicense(); // conditional shows the version notes (only if the version has changed) VersionNotes myNotes2 = new VersionNotes(this); myNotes2.showVersionNotes(); break; case FIRST_TIME_VERSION: AppManager.CopyAssetFileOrDir("BikeBadger.pdf", context); // conditional shows the version notes (only if the version has changed) VersionNotes myNotes1 = new VersionNotes(this); myNotes1.showVersionNotes(); break; } if (AppManager.IsPackageInstalled("net.dinglisch.android.taskerm", context)) { Log.d(Constants.APP.TAG, "Tasker Installed"); } if (AppManager.IsPackageInstalled("com.strava", context)) { Log.d(Constants.APP.TAG, "Strava Installed"); } else { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.google.android.apps.maps")); startActivity(intent); } if (AppManager.IsPackageInstalled("com.maxmpz.audioplayer", context)) { Log.d(Constants.APP.TAG, "PowerAMP Installed"); } }
From source file:com.jwork.dhammapada.MainActivity.java
public void displayChangeLog() { AlertDialog dialog = new AlertDialog.Builder(this).create(); dialog.setTitle("Changelog"); WebView wv = new WebView(this); wv.loadData(getString(R.string.changelog_dialog_text), "text/html", "utf-8"); wv.setScrollContainer(true);/*from w w w . j av a2s . c om*/ dialog.setView(wv); dialog.setButton(AlertDialog.BUTTON_NEGATIVE, getString(android.R.string.ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Configuration.getInstance(MainActivity.this) .setCurrentVersion(CrashHandler.getVersionCode(MainActivity.this)); dialog.dismiss(); } }); dialog.setButton(AlertDialog.BUTTON_POSITIVE, "Rate It", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Configuration.getInstance(MainActivity.this) .setCurrentVersion(CrashHandler.getVersionCode(MainActivity.this)); dialog.dismiss(); Uri uri = Uri.parse("market://details?id=" + MainActivity.this.getPackageName()); Intent myAppLinkToMarket = new Intent(Intent.ACTION_VIEW, uri); try { MainActivity.this.startActivity(myAppLinkToMarket); } catch (ActivityNotFoundException e) { Toast.makeText(MainActivity.this, "Failed to find Market application", Toast.LENGTH_LONG) .show(); } } }); dialog.setButton(AlertDialog.BUTTON_NEUTRAL, "Donate", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Configuration.getInstance(MainActivity.this) .setCurrentVersion(CrashHandler.getVersionCode(MainActivity.this)); dialog.dismiss(); openDonate(); } }); dialog.show(); }
From source file:com.swissbit.homeautomation.asyncTask.AuthenticationAsync.java
/** *Show the dialog message after the RaspberryPi authentication *///from w w w . ja v a 2s .c om public void showDialog() { AlertDialog alertDialog = new AlertDialog.Builder(mainActivityContext).create(); alertDialog.setTitle("Information"); alertDialog.setMessage(dialogMessage); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if (subscriptionResponse) mainActivity.checkRaspberryId(rid); dialog.dismiss(); cancel(true); } }); alertDialog.show(); }
From source file:edu.rutgers.winlab.crowdpp.ui.MainActivity.java
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // exit the app case R.id.exit: Toast.makeText(this, "Closing...", Toast.LENGTH_SHORT).show(); //System.exit(0); this.finish(); break;/*from w ww .ja v a 2s.c o m*/ // show the FAQ case R.id.help: AlertDialog dialog = new AlertDialog.Builder(this).create(); dialog.setTitle("FAQ"); dialog.setMessage(Constants.FAQ); dialog.setButton(AlertDialog.BUTTON_POSITIVE, "Close", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); dialog.show(); dialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextSize(20); break; default: return super.onOptionsItemSelected(item); } return true; }
From source file:com.example.ramap.MainActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { // TODO Auto-generated method stub switch (item.getItemId()) { //TODO: Open HistoryActivity.java with ListView Array of SharedPreferences values. case R.id.check_in_history_menu: SharedPreferences loadHistory = getSharedPreferences(SAVE, MODE_PRIVATE); currentLocation = loadHistory.getString("name", "You're not checked in!"); //currentLocation.setText(String.valueOf(notCheckedIn)); loadHistory.getString(SAVE, ""); Toast.makeText(getApplicationContext(), ("Previous check in loaded successfully!\n" + currentLocation), Toast.LENGTH_SHORT).show(); //Intent intent = new Intent (getApplicationContext(), HistoryActivity.class); //startActivity(intent); // starts break;/*from w ww .ja v a 2 s . c o m*/ //TODO: This should open a SettingsActivity.java to change settings on the application. //case R.id.settings_menu: // Toast.makeText(getBaseContext(), "Settings option doesn't work yet.", Toast.LENGTH_SHORT).show(); // break; case R.id.about_menu: AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setTitle("About RaMap"); alertDialog.setMessage("Developed for CISC 4400 by:\n" + "Joseph LeRoy\n" + "Kevin McCarthy\n" + "Alexander Despotakis\n" + "Fizan Imtiaz"); alertDialog.show(); //Toast.makeText(getBaseContext(), "Created by: Joseph LeRoy, Kevin McCarthy, Alexander Despotakis, Fizan Imtiaz", Toast.LENGTH_SHORT).show(); } return super.onOptionsItemSelected(item); }
From source file:com.prof.rssparser.example.MainActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { android.support.v7.app.AlertDialog alertDialog = new android.support.v7.app.AlertDialog.Builder( MainActivity.this).create(); alertDialog.setTitle(R.string.app_name); alertDialog.setMessage(Html.fromHtml(MainActivity.this.getString(R.string.info_text) + " <a href='http://github.com/prof18/RSS-Parser'>GitHub.</a>" + MainActivity.this.getString(R.string.author))); alertDialog.setButton(android.support.v7.app.AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); }// w ww.j a v a 2 s .com }); alertDialog.show(); ((TextView) alertDialog.findViewById(android.R.id.message)) .setMovementMethod(LinkMovementMethod.getInstance()); } return super.onOptionsItemSelected(item); }