Android Open Source - Dialog4Android Main Activity






From Project

Back to project page Dialog4Android.

License

The source code is released under:

Copyright (c) 2014, Calvin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redis...

If you think the Android project Dialog4Android 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

/**
 * @Title: MainACtivity.java/*from  ww w .  j  a va2s .  c  o  m*/
 * @Description: TODO
 * @author: Calvinyang
 * @date: Jun 11, 2014 2:04:54 PM
 * Copyright: Copyright (c) 2013
 * @version: 1.0
 */
package cn.edu.fudan.calvin;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;

/**
 * @author: Calvinyang
 * @Description: TODO
 * @date: Jun 11, 2014 2:04:54 PM
 */
public class MainActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    findViewById(R.id.alert).setOnClickListener(new OnClickListener() {

      @Override
      public void onClick(View v) {
        new AlertDialog(MainActivity.this, "xxxx").show();
      }
    });
    findViewById(R.id.confirm).setOnClickListener(new OnClickListener() {

      @Override
      public void onClick(View v) {
        final ConfirmDialog dlg = new ConfirmDialog(MainActivity.this, "xxxx ?");
        dlg.show();
        dlg.setButton("yes", "no !");
        dlg.setListener(new OnClickListener() {
          
          @Override
          public void onClick(View v) {
            dlg.dismiss();
            Log.e("xxx", "yes");
          }
        }, new OnClickListener() {
          
          @Override
          public void onClick(View v) {
            dlg.dismiss();
            Log.e("xxx", "no");
          }
        });
      }
    });
  }
}




Java Source Code List

cn.edu.fudan.calvin.AlertDialog.java
cn.edu.fudan.calvin.CommonUtils.java
cn.edu.fudan.calvin.ConfirmDialog.java
cn.edu.fudan.calvin.MainActivity.java