не открывает почтовое приложение на моем телефоне - PullRequest
0 голосов
/ 26 февраля 2020

я хочу знать проблему

, когда я нажимаю на кнопку отправить, это не превращает меня в приложение электронной почты, и это мой код

publi c void submitOrder (Просмотреть представление) {

    EditText name =(EditText)findViewById(R.id.Name);
    String Name = name.getText().toString();
    CheckBox wippedCreame  = (CheckBox) this.<View>findViewById(R.id.chb);
    boolean haswippedCreame = wippedCreame.isChecked();
    CheckBox chocolate = (CheckBox)findViewById(R.id.choclatecheeckbox);
    boolean haschocolate = chocolate.isChecked();

    int price = calculatePrice(haswippedCreame,haschocolate);
    String priceMessage= createOrderSummary(Name , price , haswippedCreame , haschocolate);
    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.setData(Uri.parse("mailTo:"));

    intent.putExtra(Intent.EXTRA_TEXT,"just java order"+ priceMessage);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}
...