使用浮动操作按钮向开发人员发送电子邮件

时间:2016-01-11 06:45:11

标签: java android material-design

我希望能够通过按电子邮件工厂图标让用户向开发人员发送电子邮件。它应该像分享意图一样开放。

enter image description here

1 个答案:

答案 0 :(得分:1)

对于FAB教程,请从AndroidHive的教程中查看 http://www.androidhive.info/2015/12/android-material-design-floating-action-button/

向开发者发送电子邮件。

FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
               Intent Email = new Intent(Intent.ACTION_SEND);
            Email.setType("text/email");
            Email.putExtra(Intent.EXTRA_EMAIL,
                    new String[]{"developeremail@gmail.com"});  //developer 's email
            Email.putExtra(Intent.EXTRA_SUBJECT,
                    "Add your Subject"); // Email 's Subject
            Email.putExtra(Intent.EXTRA_TEXT, "Dear Developer Name," + "");  //Email 's Greeting text
            startActivity(Intent.createChooser(Email, "Send Feedback:"));
            }
        });