Newer
Older
NemophilaClient / app / src / main / java / com / example / nemophila / RequestingDialogFragment.java
k-fujii on 6 Jul 2023 1007 bytes RequestingActivityの更新
  1. package com.example.nemophila;
  2.  
  3. import android.app.Dialog;
  4. import android.content.DialogInterface;
  5. import android.os.Bundle;
  6.  
  7. import androidx.annotation.NonNull;
  8. import androidx.annotation.Nullable;
  9. import androidx.appcompat.app.AlertDialog;
  10. import androidx.fragment.app.DialogFragment;
  11.  
  12. public class RequestingDialogFragment extends DialogFragment {
  13.  
  14. @NonNull
  15. @Override
  16. public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
  17. AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
  18. builder.setTitle("フレンド申請")
  19. .setMessage("IDにあったユーザー")
  20. .setPositiveButton("申請を送る", new DialogInterface.OnClickListener() {
  21. public void onClick(DialogInterface dialog, int id) {
  22. // ボタンを押した時の処理
  23. }
  24. })
  25. .setNegativeButton("キャンセル", null);
  26. return builder.create();
  27. }
  28.  
  29. }