public void onCall(View view) {
        boolean hasCallPhonePermission = ContextCompat.checkSelfPermission(this,
            Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED;

        if (hasCallPhonePermission)
            startActivity(createCallIntentFromNumber());
        else
            Toast.makeText(this, R.string.warning_call_phone_permission, Toast.LENGTH_SHORT).show();
    }
Simple Dialer Activity which shows an {@link EditText} field to enter a phone number. Upon
pressing the call button the number entered in the input field is send to the native Android
Dialer app via {@link Intent#ACTION_CALL}.

<p>
Furthermore this Activity contains a pick number button to starts dummy contacts activity to
demonstrate Intent stubbing.
ui/espresso/IntentsBasicSample/app/src/main/java/com/example/android/testing/espresso/IntentsBasicSample/DialerActivity.java