Search in sources :

Example 1 with ContactUsHandler

use of ingage.ingage.handlers.ContactUsHandler in project iNGAGE by davis123123.

the class ContactUsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_contact_us);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle(getResources().getString(R.string.contact_us_title));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);
    session = new SessionManager(this);
    HashMap<String, String> user = session.getUserDetails();
    final String email = user.get(SessionManager.KEY_EMAIL);
    // etSender = (EditText) findViewById(R.id.et_email_sender);
    etSubject = (EditText) findViewById(R.id.et_email_title);
    etMessage = (EditText) findViewById(R.id.et_email_content);
    btnEmailUs = (Button) findViewById(R.id.btnEmailUs);
    btnEmailUs.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            String subject = String.valueOf(etSubject.getText());
            String message = String.valueOf(etMessage.getText());
            if (etSubject.getText().length() == 0) {
                Toast.makeText(ContactUsActivity.this, "Please enter subject line", Toast.LENGTH_SHORT).show();
            } else if (etMessage.getText().length() == 0) {
                Toast.makeText(ContactUsActivity.this, "Please enter your message", Toast.LENGTH_SHORT).show();
            } else {
                loadingDialog();
                String type = "submit";
                ContactUsHandler contactUsHandler = new ContactUsHandler(ContactUsActivity.this);
                contactUsHandler.execute(type, email, subject, message);
            }
        }
    });
}
Also used : SessionManager(ingage.ingage.managers.SessionManager) ContactUsHandler(ingage.ingage.handlers.ContactUsHandler) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)1 View (android.view.View)1 ContactUsHandler (ingage.ingage.handlers.ContactUsHandler)1 SessionManager (ingage.ingage.managers.SessionManager)1