如何实现"发送反馈"在Android的功能? [英] How to implement "Send Feedback" feature in Android?

查看:155
本文介绍了如何实现"发送反馈"在Android的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这样的行为就像当你点击发送反馈行为就在Google+的Andr​​oid应用程序的菜单项。

I would like this to behave just like the "Send Feedback" behaves when you click on the Menu item in the Google+ Android app.

推荐答案

我不完全知道如何这个程序的行为与发送反馈。你能解释给我,所以我没有下载的应用程序?

I'm not exactly sure how this app behaves with the "Send Feedback". Could you explain it to me, so I do not have to download the app?

由于我不知道它是什么样子,我只是要采取猜测和让用户发送反馈信息的一种方式为您提供:

As I do not know what it looks like, I am just going to take a guess and supply you with one way of letting the user send feedback:

@Override
public boolean onCreateOptionsMenu(Menu menu){
    super.onCreateOptionsMenu(menu);
    MenuInflater hardwaremenu = getMenuInflater();
    hardwaremenu.inflate(R.menu.main_menu, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item){
    switch (item.getItemId()){
    case R.id.sendEmail:
        Intent Email = new Intent(Intent.ACTION_SEND);
        Email.setType("text/email");
        Email.putExtra(Intent.EXTRA_EMAIL, new String[] { "admin@hotmail.com" });
        Email.putExtra(Intent.EXTRA_SUBJECT, "Feedback");
        Email.putExtra(Intent.EXTRA_TEXT, "Dear ...," + "");
        startActivity(Intent.createChooser(Email, "Send Feedback:"));
        return true;
    }
}

无论是将这一到现有的菜单,或简单地添加到这个活动的底部,你想显示菜单。

Either incorporate this into your existing menu or simply add this onto the bottom of the Activity that you would like to display the menu.

我希望这有助于!

这篇关于如何实现"发送反馈"在Android的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆