Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 11-26 18:09:43.721: I/Choreographer(790): Skipped 31 frames! The application may be doing too much work on its main thread.
- 11-26 18:09:43.971: D/gralloc_goldfish(790): Emulator without GPU emulation detected.
- 11-26 18:10:22.246: D/dalvikvm(790): GC_FOR_ALLOC freed 87K, 9% free 2556K/2788K, paused 27ms, total 30ms
- 11-26 18:10:22.476: I/Choreographer(790): Skipped 86 frames! The application may be doing too much work on its main thread.
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
- <Button
- android:id="@+id/btnSendEmail"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:onClick="onClick"
- android:text="Send Email" />
- </LinearLayout>
- package br.com.google.sms2;
- import com.example.sms2.R;
- import android.app.Activity;
- import android.content.Intent;
- import android.net.Uri;
- import android.os.Bundle;
- import android.view.View;
- public class EmailsActivity extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
- public void onClick(View v) {
- String[] to = { "tecnico100@gmail.com" };
- String[] cc = { "tekaband@gmail.com" };
- sendEmail(to, cc, "hello", "helo meu amigo");
- }
- private void sendEmail(String[] emailAddresses, String[] carbonCopies,
- String subject, String message) {
- Intent emailIntent = new Intent(Intent.ACTION_SEND);
- emailIntent.setData(Uri.parse("mailto:"));
- String[] to = emailAddresses;
- String[] cc = carbonCopies;
- emailIntent.putExtra(Intent.EXTRA_EMAIL, to);
- emailIntent.putExtra(Intent.EXTRA_CC, cc);
- emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
- emailIntent.putExtra(Intent.EXTRA_TEXT, message);
- emailIntent.setType("message/rfc822");
- startActivity(Intent.createChooser(emailIntent, "Email"));
- }
- }
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.sms2"
- android:versionCode="1"
- android:versionName="1.0" >
- <uses-sdk
- android:minSdkVersion="8"
- android:targetSdkVersion="17" />
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity android:name="br.com.google.sms2.EmailsActivity" android:label="@string/app_name">
- <intent-filter >
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- </application>
- </manifest>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement