Home > Android > Android Program – Email Activity

Android Program – Email Activity

android email snippet activity code download

ANDROID FOR FRESHER

Android Program Email Activity

 

Java Code(EmailAct)

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class EmailAct extends Activity {

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

public void email_send(View v)
{
Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra(Intent.EXTRA_TEXT,”Hello \n \n \n \n \n” +
” \n” +
” \n” +
” \n \n” +
” \n” +
” \n” +
” \n Best Regards “);
i.setType(“text/html”); // MIME type

Intent i1 = Intent.createChooser(i,”Select the Best”);
startActivity(i1);
}
 }

Layout XML Code( activity_email)

<?xml version=”1.0″ encoding=”utf-8″?>
<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:tools=”http://schemas.android.com/tools”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:paddingBottom=”@dimen/activity_vertical_margin”
android:paddingLeft=”@dimen/activity_horizontal_margin”
android:paddingRight=”@dimen/activity_horizontal_margin”
android:orientation=”vertical”
android:paddingTop=”@dimen/activity_vertical_margin”
tools:context=”com.andro.tech.androidproject.EmailAct”>

<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:textSize=”@dimen/textsize”
android:layout_gravity=”center”
android:textStyle=”bold”
android:text=”Email”
android:layout_marginBottom=”150dp” />

<Button
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:layout_gravity=”center”
android:text=”SEND”
android:onClick=”email_send”
android:layout_marginBottom=”150dp”/>

<Button
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:text=”@string/sourcecode”
android:background=”@color/bgcolor”
android:textStyle=”bold”
android:textColor=”@color/text”
android:onClick=”view1″/>

</LinearLayout>

 

Output

       

Android email snippet activity code download

Download Android Email Activity Source Code


For More Android Programs –Click Here

 

Follow Us – Never Miss Update

Fb/PageTwitterGoogle+InstagramPinterest 

 

Related Search

android email snippet activity code download, Android email activity code download, android email snippet code download, android email sending code download, android email java code download, email snippet for android dwonload, android email snippet activity code download, android email snippet activity source code, android email java code for sending mail, email activity java code android, android email open code download

Is This Content Useful For You?