Here you can find the source of newMessageDialog(final Context context, String dialogTitle, String screenMessage, int iconResourceId)
Parameter | Description |
---|---|
context | a parameter |
dialogTitle | a parameter |
screenMessage | a parameter |
iconResourceId | a parameter |
public static AlertDialog newMessageDialog(final Context context, String dialogTitle, String screenMessage, int iconResourceId)
//package com.java2s; /* Copyright (c) 2009 Matthias K?ppler * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License./*from ww w . jav a2 s. c o m*/ */ import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; public class Main { /** * Creates a new AlertDialog to display a simple message * * @param context * @param dialogTitle * @param screenMessage * @param iconResourceId * @return */ public static AlertDialog newMessageDialog(final Context context, String dialogTitle, String screenMessage, int iconResourceId) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(false); builder.setPositiveButton("Okay", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.setTitle(dialogTitle); builder.setMessage(screenMessage); builder.setIcon(iconResourceId); return builder.create(); } }