blablalloro

by ivanhoe on March 21st, 2012
No notes
Syntax: Java
Show lines - Hide lines - Show in textbox - Download
        protected void onPostExecute(Boolean result) {
            QuizSettingsActivity.this.setProgressBarIndeterminateVisibility(false);
            if(!result) {
            	AlertDialog.Builder builder = new AlertDialog.Builder(getApplicationContext());
            	builder.setMessage("The requested user wasn't found, do you want to send him a mail to join BTDT?");
            	builder.setCancelable(false);
            	builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
            			public void onClick(DialogInterface dialog, int id) {
            				Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
            				emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Join BTDT!");
            				emailIntent.setType("plain/text");
            				emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Download the app and start playing.");
            				startActivity(emailIntent);
            			}
            	});
            	builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
            			public void onClick(DialogInterface dialog, int id) {
            				dialog.cancel();
            			}
            	});
            	AlertDialog alert = builder.create();
            	alert.show();
            }
            else {
            	String toastText = getResources().getString(R.string.friend_operation_succeeded);
            	Toast.makeText(QuizSettingsActivity.this, toastText, Toast.LENGTH_SHORT).show();
            }
        }

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS