ContactUs (Contact details of Developer)

ContactUs.java




 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.ramesh.taskearnerexample;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.CardView;
import android.view.View;
import android.widget.Button;

public class ContactUs extends AppCompatActivity {

    private Button emailUs;
    private CardView cardView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_contact_us );

        cardView = (CardView) findViewById( R.id.cardView );

        emailUs = (Button) findViewById( R.id.EmailUs );
        emailUs.setOnClickListener( new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                sendMail();

            }

            private void sendMail() {

                Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
                        "mailto", "yourmail@gmail.com", null));
                startActivity(Intent.createChooser(intent, "Choose an Email App :"));
            }
        } );
    }
}
Powered by Blogger.