Blame view

PremiereActivite/app/src/main/java/com/example/app_10p5/Dialogue.java 979 Bytes
9f0e5ffc   JLo'w   Un petit popup de...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  package com.example.app_10p5;
  
  import android.app.AlertDialog;
  import android.app.Dialog;
  import android.app.DialogFragment;
  import android.content.DialogInterface;
  import android.os.Bundle;
  
  /**
   * Created by Jean-loup Beaussart on 07/05/2016.
   */
  public class Dialogue extends DialogFragment {
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
          // Use the Builder class for convenient dialog construction
          AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
          builder.setMessage("Session expirée")
                  .setPositiveButton("ok", new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int id) {
                          MainActivite parent = (MainActivite) getActivity();
                          parent.disconnect();
                      }
                  });
          // Create the AlertDialog object and return it
          return builder.create();
      }
  }