Newer
Older
NemophilaClient / app / src / main / java / com / example / nemophila / RequestingDialogFragment.java
k-fujii on 6 Jul 2023 1007 bytes RequestingActivityの更新
package com.example.nemophila;

import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;

public class RequestingDialogFragment extends DialogFragment {

    @NonNull
    @Override
    public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        builder.setTitle("フレンド申請")
                .setMessage("IDにあったユーザー")
                .setPositiveButton("申請を送る", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        // ボタンを押した時の処理
                    }
                })
                .setNegativeButton("キャンセル", null);
        return builder.create();
    }

}