简体   繁体   English

我尝试在我的小型 android 项目中使用意向电子邮件,但它不起作用。 谁能帮我找出错误?

[英]I tried to use intent email in my small android project but its not working. Can anyone help me to find the error?

public void submit_order(View view) { //For ORDER button EditText name_var = (EditText) findViewById(R.id.name); public void submit_order(View view) { //对于 ORDER 按钮 EditText name_var = (EditText) findViewById(R.id.name); field = name_var.getText().toString();字段 = name_var.getText().toString();

    Intent intent = new Intent(Intent.ACTION_SENDTO);                // only email apps should handle this
    intent.setData(Uri.parse("mailto:"));
    intent.putExtra(Intent.EXTRA_SUBJECT, "Just Java order for " + field);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
    display_message(field, number_of_coffee);
}

先生,在 mailto 字符串中添加电子邮件地址。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在意图android中出现错误有人尝试解决此错误并帮助我,查看SS,我尝试了三种方法来解决但没有用 - Getting error in intent android somebody try to solve this error and help me,Check out SS,I tried three methods to solve but no use 我的代码遇到了运行时错误,有人可以帮我找出我哪里错了 - i got Runtime Error for my code ,can anyone help me to find out where i am wrong 任何人都可以帮助我了解在 Android 中使用 AsyncTask 时出现错误代码 400 - Can anyone help me about I am getting error code 400 while working with AsyncTask in Android 我的回收视图不起作用。 你能帮助我吗? - My recycleview isn't working. Can you help me? 我的actionlistener不在我的多类/框架Java项目上工作,有人可以帮助我修复它吗? - My actionlistener is not working on my multi-class/frame Java project, can anyone help me fix it? 什么是 XAMPP? 任何人都可以帮助我解决它的 mySQL 错误吗? - What's XAMPP? Can anyone help me with its mySQL error? 我的构造函数不起作用,有人可以帮助我解决问题吗? - My constructor is not working can anyone help me figure out the issue? 遇到找不到或无法加载主类错误的情况,有人可以帮助我修复该错误吗? 我是Java新手 - Getting a could not find or load main class error, can anyone help me fix it? I'm new to java 我无法在程序中使用PrinterWriter,有人可以帮我解决吗? - I can't use PrinterWriter in my program, could anyone help me figure it out? 我的交换方法不起作用。 谁能帮忙找出问题所在? - My Swap method is not working. Can anyone help figure out whats wrong?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM