Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. 11-26 18:09:43.721: I/Choreographer(790): Skipped 31 frames! The application may be doing too much work on its main thread.
  2. 11-26 18:09:43.971: D/gralloc_goldfish(790): Emulator without GPU emulation detected.
  3. 11-26 18:10:22.246: D/dalvikvm(790): GC_FOR_ALLOC freed 87K, 9% free 2556K/2788K, paused 27ms, total 30ms
  4. 11-26 18:10:22.476: I/Choreographer(790): Skipped 86 frames! The application may be doing too much work on its main thread.
  5.  
  6. <?xml version="1.0" encoding="utf-8"?>
  7. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  8. android:layout_width="match_parent"
  9. android:layout_height="match_parent"
  10. android:orientation="vertical" >
  11.  
  12. <Button
  13. android:id="@+id/btnSendEmail"
  14. android:layout_width="fill_parent"
  15. android:layout_height="wrap_content"
  16. android:onClick="onClick"
  17. android:text="Send Email" />
  18.  
  19. </LinearLayout>
  20.  
  21. package br.com.google.sms2;
  22.  
  23. import com.example.sms2.R;
  24.  
  25. import android.app.Activity;
  26. import android.content.Intent;
  27. import android.net.Uri;
  28. import android.os.Bundle;
  29. import android.view.View;
  30.  
  31. public class EmailsActivity extends Activity {
  32. @Override
  33. protected void onCreate(Bundle savedInstanceState) {
  34. super.onCreate(savedInstanceState);
  35. setContentView(R.layout.main);
  36. }
  37.  
  38. public void onClick(View v) {
  39. String[] to = { "tecnico100@gmail.com" };
  40. String[] cc = { "tekaband@gmail.com" };
  41. sendEmail(to, cc, "hello", "helo meu amigo");
  42.  
  43. }
  44.  
  45. private void sendEmail(String[] emailAddresses, String[] carbonCopies,
  46. String subject, String message) {
  47. Intent emailIntent = new Intent(Intent.ACTION_SEND);
  48. emailIntent.setData(Uri.parse("mailto:"));
  49. String[] to = emailAddresses;
  50. String[] cc = carbonCopies;
  51. emailIntent.putExtra(Intent.EXTRA_EMAIL, to);
  52. emailIntent.putExtra(Intent.EXTRA_CC, cc);
  53. emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
  54. emailIntent.putExtra(Intent.EXTRA_TEXT, message);
  55. emailIntent.setType("message/rfc822");
  56. startActivity(Intent.createChooser(emailIntent, "Email"));
  57.  
  58. }
  59.  
  60. }
  61.  
  62.  
  63.  
  64.  
  65. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  66. package="com.example.sms2"
  67. android:versionCode="1"
  68. android:versionName="1.0" >
  69.  
  70. <uses-sdk
  71. android:minSdkVersion="8"
  72. android:targetSdkVersion="17" />
  73.  
  74. <application
  75. android:allowBackup="true"
  76. android:icon="@drawable/ic_launcher"
  77. android:label="@string/app_name"
  78. android:theme="@style/AppTheme" >
  79. <activity android:name="br.com.google.sms2.EmailsActivity" android:label="@string/app_name">
  80. <intent-filter >
  81. <action android:name="android.intent.action.MAIN"/>
  82. <category android:name="android.intent.category.LAUNCHER"/>
  83. </intent-filter>
  84. </activity>
  85. </application>
  86.  
  87. </manifest>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement