blablalloro
No notes
Syntax:
Java
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(); } }