// Path: app/src/main/java/me/lancer/airfree/bean/FeedbackBean.java
// public class FeedbackBean extends BmobObject {
// 
//     private String content;
// 
//     public String getContent() {
//         return content;
//     }
// 
//     public void setContent(String content) {
//         this.content = content;
//     }
// }


import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import org.w3c.dom.Text;
import cn.bmob.v3.Bmob;
import cn.bmob.v3.listener.SaveListener;
import me.lancer.airfree.bean.FeedbackBean;
import me.lancer.distance.R;
                            })
                    .show();
        } else if (v == btnCommonProblem) {
            Intent intent = new Intent();
            intent.setClass(SettingActivity.this, GuideActivity.class);
            startActivity(intent);
        } else if (v == btnFeedback) {
//            Intent data = new Intent(Intent.ACTION_SENDTO);
//            data.setData(Uri.parse("mailto:huangfangzhi0@gmail.com"));
//            data.putExtra(Intent.EXTRA_SUBJECT, "");
//            data.putExtra(Intent.EXTRA_TEXT, "");
//            startActivity(data);
            LayoutInflater inflater = LayoutInflater.from(this);
            LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.feedback_dialog_view, null);
            final Dialog dialog = new AlertDialog.Builder(SettingActivity.this).create();
            etContent = (EditText) layout.findViewById(R.id.et_content);
            etContent.setHint(strFeedbackhint);
            etContent.setFocusableInTouchMode(true);
            etContent.setFocusable(true);
            etContent.requestFocus();
            etContent.setOnEditorActionListener(new TextView.OnEditorActionListener() {

                @Override
                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                    if (actionId == EditorInfo.IME_ACTION_DONE) {
                        FeedbackBean item = new FeedbackBean();
                        item.setContent(etContent.getText().toString());
                        item.save(SettingActivity.this, new SaveListener() {
                            @Override
                            public void onSuccess() {
// Path: app/src/main/java/me/lancer/airfree/bean/FeedbackBean.java
// public class FeedbackBean extends BmobObject {
// 
//     private String content;
// 
//     public String getContent() {
//         return content;
//     }
// 
//     public void setContent(String content) {
//         this.content = content;
//     }
// }


// Path: app/src/main/java/me/lancer/airfree/activity/SettingActivity.java
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import org.w3c.dom.Text;
import cn.bmob.v3.Bmob;
import cn.bmob.v3.listener.SaveListener;
import me.lancer.airfree.bean.FeedbackBean;
import me.lancer.distance.R;

                            })
                    .show();
        } else if (v == btnCommonProblem) {
            Intent intent = new Intent();
            intent.setClass(SettingActivity.this, GuideActivity.class);
            startActivity(intent);
        } else if (v == btnFeedback) {
//            Intent data = new Intent(Intent.ACTION_SENDTO);
//            data.setData(Uri.parse("mailto:huangfangzhi0@gmail.com"));
//            data.putExtra(Intent.EXTRA_SUBJECT, "");
//            data.putExtra(Intent.EXTRA_TEXT, "");
//            startActivity(data);
            LayoutInflater inflater = LayoutInflater.from(this);
            LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.feedback_dialog_view, null);
            final Dialog dialog = new AlertDialog.Builder(SettingActivity.this).create();
            etContent = (EditText) layout.findViewById(R.id.et_content);
            etContent.setHint(strFeedbackhint);
            etContent.setFocusableInTouchMode(true);
            etContent.setFocusable(true);
            etContent.requestFocus();
            etContent.setOnEditorActionListener(new TextView.OnEditorActionListener() {

                @Override
                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                    if (actionId == EditorInfo.IME_ACTION_DONE) {
                        FeedbackBean item = new FeedbackBean();
                        item.setContent(etContent.getText().toString());
                        item.save(SettingActivity.this, new SaveListener() {
                            @Override
                            public void onSuccess() {
                                ShowToast(strFeedbackSucceeded);