This is the only activity which is not running and its making application unfortunately stopped (I am a beginner to the android and actually i'm following the THENEWBOSTON'S android series old one (and his code is running well but as I tried it out, i didn't work )
public class Email extends Activity implements View.OnClickListener {
public static final String TAG = "my_Email";
EditText personEmail, intro, personName, stupidThings, hatefulAction,
outro;
String emailAdd, begining, name, stupidAction, hateful, out;
Button sendEmail;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.email);
Log.d(TAG, "onCreate method invoked sucessful");
personEmail = (EditText) findViewById(R.id.editText1);
intro = (EditText) findViewById(R.id.editText2);
personEmail = (EditText) findViewById(R.id.editText3);
stupidThings = (EditText) findViewById(R.id.editText4);
hatefulAction = (EditText) findViewById(R.id.editText5);
outro = (EditText) findViewById(R.id.editText6);
sendEmail = (Button) findViewById(R.id.button1);
sendEmail.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Log.d(TAG, "onClick method invoked sucessful");
String emailAddress[] = { emailAdd };
Log.d(TAG, "String Array invoked sucessful");
emailAdd = personEmail.getText().toString();
begining = intro.getText().toString();
name = personName.getText().toString();
stupidAction = stupidThings.getText().toString();
hateful = hatefulAction.getText().toString();
out = outro.getText().toString();
String message = "Assalamualaikum bhai "
+ name + begining + stupidAction + hateful + out;
Log.d(TAG, "message created invoked sucessful");
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
Log.d(TAG, "ACTION SEND added to intent sucessful");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,emailAddress );
Log.d(TAG, "EMAIL ADDRESS added to intent sucessful");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"ALHAMDULILLAH SUCCESSFUL");
Log.d(TAG, "SUBJECT added to intent sucessful");
emailIntent.setType("plain/text");
Log.d(TAG, "TEXT type added to intent sucessful");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);
Log.d(TAG, "EXTRA TEXT added to intent sucessful");
startActivity(emailIntent);
Log.d(TAG, " intent called sucessful");
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
finish();
}
}
XML-File:
<?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"
android:weightSum="100" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="45" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="1dp"
android:text="Email Address(es)" />
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:paddingTop="1dp" >
<requestFocus
android:layout_width="match_parent"
android:layout_height="match_parent" />
</EditText>
<TextView
android:id="@+id/tv2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="1dp"
android:text="Information" />
<EditText
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:paddingTop="1dp" />
<TextView
android:id="@+id/tv3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="1dp"
android:text="Person's Name" />
<EditText
android:id="@+id/editText3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:paddingTop="1dp" />
<TextView
android:id="@+id/tv4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="1dp"
android:text="Studpid Things" />
<EditText
android:id="@+id/editText4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:paddingTop="1dp" />
<TextView
android:id="@+id/tv5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="1dp"
android:text="What you want to do with this person" />
<EditText
android:id="@+id/editText5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:paddingTop="1dp" />
<TextView
android:id="@+id/tv6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="1dp"
android:text="Your message" />
<EditText
android:id="@+id/editText6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:paddingTop="1dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TextView>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="15"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:text="Send Email" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="40"
android:orientation="vertical" >
<AnalogClock
android:id="@+id/analogClock1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
</LinearLayout>
</LinearLayout>
LOGCAT logfile
10-21 23:57:28.151: I/SELinux(4435): Function: `enter code here`selinux_android_load_priority [0], There is no sepolicy file.
10-21 23:57:28.151: I/SELinux(4435):
10-21 23:57:28.211: I/SELinux(4435): Function: selinux_android_load_priority , spota verifySig and checkHash pass. priority version is VE=SEPF_SM-N9005_4.4.2_0046
10-21 23:57:28.211: I/SELinux(4435):
10-21 23:57:28.211: I/SELinux(4435):
10-21 23:57:28.211: I/SELinux(4435): selinux_android_seapp_context_reload: seapp_contexts file is loaded from /data/security/spota/seapp_contexts
10-21 23:57:28.211: E/dalvikvm(4435): >>>>> Normal User
10-21 23:57:28.211: E/dalvikvm(4435): >>>>> com.example.first [ userId:0 | appId:10296 ]
10-21 23:57:28.211: D/dalvikvm(4435): Late-enabling CheckJNI
10-21 23:57:28.601: W/ApplicationPackageManager(4435): getCSCPackageItemText()
10-21 23:57:28.601: I/PersonaManager(4435): getPersonaService() name persona_policy
10-21 23:57:28.641: E/MoreInfoHPW_ViewGroup(4435): Parent view is not a TextView
10-21 23:57:28.761: D/dalvikvm(4435): GC_FOR_ALLOC freed 97K, 37% free 17033K/26708K, paused 26ms, total 27ms
10-21 23:57:28.781: I/dalvikvm-heap(4435): Grow heap (frag case) to 32.307MB for 12582928-byte allocation
10-21 23:57:28.971: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:28.981: I/Adreno-EGL(4435): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: ()
10-21 23:57:28.981: I/Adreno-EGL(4435): OpenGL ES Shader Compiler Version: E031.24.00.08+13
10-21 23:57:28.981: I/Adreno-EGL(4435): Build Date: 03/28/14 Fri
10-21 23:57:28.981: I/Adreno-EGL(4435): Local Branch: 0328_AU200_patches
10-21 23:57:28.981: I/Adreno-EGL(4435): Remote Branch:
10-21 23:57:28.981: I/Adreno-EGL(4435): Local Patches:
10-21 23:57:28.981: I/Adreno-EGL(4435): Reconstruct Branch:
10-21 23:57:29.041: D/OpenGLRenderer(4435): Enabling debug mode 0
10-21 23:57:29.091: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:30.941: W/ApplicationPackageManager(4435): getCSCPackageItemText()
10-21 23:57:30.991: E/MoreInfoHPW_ViewGroup(4435): Parent view is not a TextView
10-21 23:57:31.021: D/AbsListView(4435): Get MotionRecognitionManager
10-21 23:57:31.031: D/AbsListView(4435): onVisibilityChanged() is called, visibility : 4
10-21 23:57:31.031: D/AbsListView(4435): unregisterIRListener() is called
10-21 23:57:31.041: D/AbsListView(4435): onVisibilityChanged() is called, visibility : 0
10-21 23:57:31.041: D/AbsListView(4435): unregisterIRListener() is called
10-21 23:57:31.071: D/AbsListView(4435): unregisterIRListener() is called
10-21 23:57:31.091: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:31.091: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:31.091: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:31.101: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:31.101: D/AbsListView(4435): unregisterIRListener() is called
10-21 23:57:31.111: D/AbsListView(4435): unregisterIRListener() is called
10-21 23:57:31.121: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:31.121: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:31.121: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:31.121: D/TextLayoutCache(4435): Enable myanmar Zawgyi converter
10-21 23:57:31.141: W/IInputConnectionWrapper(4435): showStatusIcon on inactive InputConnection
10-21 23:57:40.671: D/AbsListView(4435): unregisterIRListener() is called
10-22 00:00:30.881: D/AbsListView(4435): unregisterIRListener() is called
10-22 00:00:30.991: D/AbsListView(4435): unregisterIRListener() is called
10-22 00:01:02.021: D/dalvikvm(4435): Debugger has detached; object registry had 1 entries
10-22 00:01:28.041: D/AbsListView(4435): unregisterIRListener() is called
10-22 00:01:28.621: D/AbsListView(4435): onDetachedFromWindow
10-22 00:01:28.621: D/AbsListView(4435): unregisterIRListener() is called
10-22 00:01:46.421: W/ApplicationPackageManager(6897): getCSCPackageItemText()
10-22 00:01:46.441: I/PersonaManager(6897): getPersonaService() name persona_policy
10-22 00:01:46.501: E/MoreInfoHPW_ViewGroup(6897): Parent view is not a TextView
10-22 00:01:46.611: D/dalvikvm(6897): GC_FOR_ALLOC freed 81K, 37% free 17033K/26708K, paused 19ms, total 19ms
10-22 00:01:46.641: I/dalvikvm-heap(6897): Grow heap (frag case) to 33.307MB for 12582928-byte allocation
10-22 00:01:46.751: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:46.781: I/Adreno-EGL(6897): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: ()
10-22 00:01:46.781: I/Adreno-EGL(6897): OpenGL ES Shader Compiler Version: E031.24.00.08+13
10-22 00:01:46.781: I/Adreno-EGL(6897): Build Date: 03/28/14 Fri
10-22 00:01:46.781: I/Adreno-EGL(6897): Local Branch: 0328_AU200_patches
10-22 00:01:46.781: I/Adreno-EGL(6897): Remote Branch:
10-22 00:01:46.781: I/Adreno-EGL(6897): Local Patches:
10-22 00:01:46.781: I/Adreno-EGL(6897): Reconstruct Branch:
10-22 00:01:46.821: D/OpenGLRenderer(6897): Enabling debug mode 0
10-22 00:01:46.871: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:49.051: W/ApplicationPackageManager(6897): getCSCPackageItemText()
10-22 00:01:49.071: E/MoreInfoHPW_ViewGroup(6897): Parent view is not a TextView
10-22 00:01:49.101: D/AbsListView(6897): Get MotionRecognitionManager
10-22 00:01:49.121: D/AbsListView(6897): onVisibilityChanged() is called, visibility : 4
10-22 00:01:49.121: D/AbsListView(6897): unregisterIRListener() is called
10-22 00:01:49.131: D/AbsListView(6897): onVisibilityChanged() is called, visibility : 0
10-22 00:01:49.131: D/AbsListView(6897): unregisterIRListener() is called
10-22 00:01:49.141: D/AbsListView(6897): unregisterIRListener() is called
10-22 00:01:49.181: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:49.181: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:49.191: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:49.191: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:49.191: D/AbsListView(6897): unregisterIRListener() is called
10-22 00:01:49.191: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:49.191: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:49.201: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:49.201: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:49.211: D/AbsListView(6897): unregisterIRListener() is called
10-22 00:01:49.221: D/AbsListView(6897): unregisterIRListener() is called
10-22 00:01:51.121: D/AbsListView(6897): unregisterIRListener() is called
10-22 00:01:51.121: W/ApplicationPackageManager(6897): getCSCPackageItemText()
10-22 00:01:51.141: E/MoreInfoHPW_ViewGroup(6897): Parent view is not a TextView
10-22 00:01:51.221: D/my_Email(6897): onCreate method invoked sucessful
10-22 00:01:51.261: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.261: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.261: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.261: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.271: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.271: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.271: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.301: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.301: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.311: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.311: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.311: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.311: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.311: D/TextLayoutCache(6897): Enable myanmar Zawgyi converter
10-22 00:01:51.671: D/AbsListView(6897): onVisibilityChanged() is called, visibility : 4
10-22 00:01:51.671: D/AbsListView(6897): unregisterIRListener() is called
10-22 00:01:52.581: D/my_Email(6897): onClick method invoked sucessful
10-22 00:01:52.581: D/my_Email(6897): String Array invoked sucessful
10-22 00:01:52.581: D/AndroidRuntime(6897): Shutting down VM
10-22 00:01:52.581: W/dalvikvm(6897): threadid=1: thread exiting with uncaught exception (group=0x417d1da0)
10-22 00:01:52.581: E/AndroidRuntime(6897): FATAL EXCEPTION: main
10-22 00:01:52.581: E/AndroidRuntime(6897): Process: com.example.first, PID: 6897
10-22 00:01:52.581: E/AndroidRuntime(6897): java.lang.NullPointerException
10-22 00:01:52.581: E/AndroidRuntime(6897): at com.example.first.Email.onClick(Email.java:57)
10-22 00:01:52.581: E/AndroidRuntime(6897): at android.view.View.performClick(View.java:4630)
10-22 00:01:52.581: E/AndroidRuntime(6897): at android.view.View$PerformClick.run(View.java:19339)
10-22 00:01:52.581: E/AndroidRuntime(6897): at android.os.Handler.handleCallback(Handler.java:733)
10-22 00:01:52.581: E/AndroidRuntime(6897): at android.os.Handler.dispatchMessage(Handler.java:95)
10-22 00:01:52.581: E/AndroidRuntime(6897): at android.os.Looper.loop(Looper.java:157)
10-22 00:01:52.581: E/AndroidRuntime(6897): at android.app.ActivityThread.main(ActivityThread.java:5335)
10-22 00:01:52.581: E/AndroidRuntime(6897): at java.lang.reflect.Method.invokeNative(Native Method)
10-22 00:01:52.581: E/AndroidRuntime(6897): at java.lang.reflect.Method.invoke(Method.java:515)
10-22 00:01:52.581: E/AndroidRuntime(6897): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
10-22 00:01:52.581: E/AndroidRuntime(6897): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
10-22 00:01:52.581: E/AndroidRuntime(6897): at dalvik.system.NativeStart.main(Native Method)
10-22 00:01:54.381: I/Process(6897): Sending signal. PID: 6897 SIG: 9
10-22 00:01:54.651: W/ApplicationPackageManager(7555): getCSCPackageItemText()
10-22 00:01:54.651: I/PersonaManager(7555): getPersonaService() name persona_policy
10-22 00:01:54.691: E/MoreInfoHPW_ViewGroup(7555): Parent view is not a TextView
10-22 00:01:54.721: D/AbsListView(7555): Get MotionRecognitionManager
10-22 00:01:54.751: D/AbsListView(7555): onVisibilityChanged() is called, visibility : 4
10-22 00:01:54.751: D/AbsListView(7555): unregisterIRListener() is called
10-22 00:01:54.761: D/AbsListView(7555): onVisibilityChanged() is called, visibility : 0
10-22 00:01:54.761: D/AbsListView(7555): unregisterIRListener() is called
10-22 00:01:54.771: D/AbsListView(7555): unregisterIRListener() is called
10-22 00:01:54.771: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.791: I/Adreno-EGL(7555): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: ()
10-22 00:01:54.791: I/Adreno-EGL(7555): OpenGL ES Shader Compiler Version: E031.24.00.08+13
10-22 00:01:54.791: I/Adreno-EGL(7555): Build Date: 03/28/14 Fri
10-22 00:01:54.791: I/Adreno-EGL(7555): Local Branch: 0328_AU200_patches
10-22 00:01:54.791: I/Adreno-EGL(7555): Remote Branch:
10-22 00:01:54.791: I/Adreno-EGL(7555): Local Patches:
10-22 00:01:54.791: I/Adreno-EGL(7555): Reconstruct Branch:
10-22 00:01:54.861: D/OpenGLRenderer(7555): Enabling debug mode 0
10-22 00:01:54.871: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.871: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.871: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.871: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.871: D/AbsListView(7555): unregisterIRListener() is called
10-22 00:01:54.881: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.881: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.881: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.881: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.891: D/TextLayoutCache(7555): Enable myanmar Zawgyi converter
10-22 00:01:54.921: D/AbsListView(7555): unregisterIRListener() is called
10-22 00:01:54.941: D/AbsListView(7555): unregisterIRListener() is called
10-22 00:01:55.011: D/AbsListView(7555): unregisterIRListener() is called