Android Open Source - Swinedroid Error Message Handler






From Project

Back to project page Swinedroid.

License

The source code is released under:

GNU General Public License

If you think the Android project Swinedroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.legind.Dialogs;
/*  ww  w.j ava2s. co m*/
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.legind.swinedroid.R;

public class ErrorMessageHandler extends MessageHandler{

  public ErrorMessageHandler(Context ctx, View v) {
    super(ctx, v);
  }

  public ErrorMessageHandler(View v){
    super(v);
  }
  
  public void DisplayErrorMessage(String message, OnCancelListener cancelListener){
    final Builder builder;
    Dialog alertDialog;

    OnClickListener okListener = new OnClickListener() {
      public void onClick(DialogInterface dialog, int which) {
        dialog.cancel();
        return;
      }
    };
    LayoutInflater inflater = (LayoutInflater) mCtx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View layout = inflater.inflate(R.layout.server_edit_error,
        ((ViewGroup) mV));

    TextView text = (TextView) layout.findViewById(R.id.server_edit_error_text);
    text.setText(message);

    ImageView image = (ImageView) layout.findViewById(R.id.server_edit_error_icon);
    image.setImageResource(R.drawable.icon);

    builder = new AlertDialog.Builder(mCtx);
    builder.setView(layout);
    builder.setPositiveButton("Ok", okListener);
    builder.setOnCancelListener(cancelListener);
    alertDialog = builder.create();
    alertDialog.show();
  }

  public void DisplayErrorMessage(String message) {
    OnCancelListener cancelListener = new OnCancelListener() {
      public void onCancel(DialogInterface dialog) {
        return;
      }
    };
    DisplayErrorMessage(message, cancelListener);
  }
}




Java Source Code List

com.legind.Dialogs.ErrorMessageHandler.java
com.legind.Dialogs.MessageHandler.java
com.legind.sqlite.AlertDbAdapter.java
com.legind.sqlite.DbAdapter.java
com.legind.sqlite.ServerDbAdapter.java
com.legind.ssl.CertificateInspect.CertificateInspect.java
com.legind.ssl.SSLHandler.SSLHandler.java
com.legind.ssl.TrustManagerFactory.TrustManagerFactory.java
com.legind.swinedroid.AlertList.java
com.legind.swinedroid.AlertSearch.java
com.legind.swinedroid.AlertView.java
com.legind.swinedroid.ServerEdit.java
com.legind.swinedroid.ServerHashDialog.java
com.legind.swinedroid.ServerView.java
com.legind.swinedroid.Swinedroid.java
com.legind.swinedroid.NetworkRunnable.NetworkRunnableBindRequires.java
com.legind.swinedroid.NetworkRunnable.NetworkRunnableManager.java
com.legind.swinedroid.NetworkRunnable.NetworkRunnableRequires.java
com.legind.swinedroid.NetworkRunnable.NetworkRunnableUniqueRequires.java
com.legind.swinedroid.NetworkRunnable.NetworkRunnable.java
com.legind.swinedroid.RequestService.RequestElement.java
com.legind.swinedroid.RequestService.Request.java
com.legind.swinedroid.xml.AlertListXMLElement.java
com.legind.swinedroid.xml.AlertListXMLHandler.java
com.legind.swinedroid.xml.AlertXMLElement.java
com.legind.swinedroid.xml.AlertXMLHandler.java
com.legind.swinedroid.xml.OverviewXMLElement.java
com.legind.swinedroid.xml.OverviewXMLHandler.java
com.legind.swinedroid.xml.XMLHandlerException.java
com.legind.swinedroid.xml.XMLHandler.java
com.legind.web.WebTransport.WebTransportConnection.java
com.legind.web.WebTransport.WebTransportException.java
com.legind.web.WebTransport.WebTransport.java
org.achartengine.chartlib.AbstractChart.java
org.achartengine.chartlib.AlertChart.java