Android AlertDialog Create canShowAlertDialog(Context context)

Here you can find the source of canShowAlertDialog(Context context)

Description

can Show Alert Dialog

License

Open Source License

Declaration

private static boolean canShowAlertDialog(Context context) 

Method Source Code

//package com.java2s;
// Use of this source code is governed by a BSD-style license that can be

import android.app.Activity;

import android.content.Context;

public class Main {
    private static boolean canShowAlertDialog(Context context) {
        // We can only display the alert dialog if mContext is
        // an Activity context.
        // FIXME: Should we display dialogs if mContext does
        // not have the window focus (e.g. if the user is viewing
        // another Activity when the alert should be displayed) ?
        // See bug 3166409
        return context instanceof Activity;
    }/* ww  w. ja  v a 2  s  .c o m*/
}

Related

  1. alert(String title, String message, Context context)
  2. alert(String title, String message, Context context, boolean linksClickable)
  3. confirm(String title, String message, Context context, DialogInterface.OnClickListener onConfirmListener)
  4. confirm(String title, View view, Context context, DialogInterface.OnClickListener onConfirmListener)
  5. confirmBuilder(String title, Context context, DialogInterface.OnClickListener onConfirmListener)
  6. buildAlertMessageNoGps(final Context context)
  7. alert(Context ctx, String msg)
  8. showAlert(Context context, String title, String message)
  9. showAlertDialog(Context context, String title, String message)