package com.example.cosmosclient.views; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; public class RequestPermissionsActivity extends AppCompatActivity { private ActivityCompat.OnRequestPermissionsResultCallback listener = null; public void setOnRequestPermissionsResultCallback(ActivityCompat.OnRequestPermissionsResultCallback listener) { this.listener = listener; } // 結果の受け取り @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { listener.onRequestPermissionsResult(requestCode, permissions, grantResults); } }