Android Open Source - formulize-android Logout Dialog Fragment






From Project

Back to project page formulize-android.

License

The source code is released under:

GNU General Public License

If you think the Android project formulize-android 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 ca.formulize.android.ui;
//w  w  w .j  a  va  2s .c om
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
import ca.formulize.android.R;
import ca.formulize.android.connection.FUserSession;
import ca.formulize.android.connection.LogoutAsyncTask;
import ca.formulize.android.data.ConnectionInfo;

/**
 * A dialog confirmation for logging out the user.
 * @author timch326
 *
 */
public class LogoutDialogFragment extends DialogFragment {

  public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setTitle(R.string.dialog_title_logout)
         .setMessage(R.string.dialog_message_logout)
         .setNegativeButton(android.R.string.no, 
             new DialogInterface.OnClickListener() {
            
            @Override
            public void onClick(DialogInterface dialog, int which) {
              dialog.dismiss();
            }
          })
         .setPositiveButton(android.R.string.yes, 
             new DialogInterface.OnClickListener() {
            
            @Override
            public void onClick(DialogInterface dialog, int which) {
              ConnectionInfo connectionInfo = FUserSession.getInstance().getConnectionInfo();
              FragmentActivity activity = LogoutDialogFragment.this.getActivity();
              new LogoutAsyncTask(activity).execute(connectionInfo);              
            }
          });
    
    return builder.create();
  }
}




Java Source Code List

ca.formulize.android.connection.FUserSession.java
ca.formulize.android.connection.LoginRunnable.java
ca.formulize.android.connection.LogoutAsyncTask.java
ca.formulize.android.connection.NetworkStateReceiver.java
ca.formulize.android.data.ConnectionInfo.java
ca.formulize.android.data.FormulizeApplication.java
ca.formulize.android.data.FormulizeDBContract.java
ca.formulize.android.data.FormulizeDBHelper.java
ca.formulize.android.data.FormulizeLink.java
ca.formulize.android.ui.AddConnectionActivity.java
ca.formulize.android.ui.ApplicationListActivity.java
ca.formulize.android.ui.ConnectionActivity.java
ca.formulize.android.ui.LoginDialogFragment.java
ca.formulize.android.ui.LogoutDialogFragment.java
ca.formulize.android.ui.NoNetworkDialogFragment.java
ca.formulize.android.ui.ScreenListActivity.java
ca.formulize.android.ui.ScreenWebActivity.java
ca.formulize.android.util.ConnectionUtil.java