Android simple app crashing when I open it
<p>My main class: </p>

<pre><code>package com.example.hi;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;


public class SampleLogin extends Activity {

 EditText txtUserName;
 EditText txtPassword;
 Button btnLogin;
 Button btnCancel;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        txtUserName=(EditText)this.findViewById(R.id.txtUname);
        txtPassword=(EditText)this.findViewById(R.id.txtPwd);
        btnLogin=(Button)this.findViewById(R.id.btnLogin);
        btnLogin=(Button)this.findViewById(R.id.btnLogin);
        btnLogin.setOnClickListener(new OnClickListener() {

   @Override
   public void onClick(View v) {
    // TODO Auto-generated method stub

    if((txtUserName.getText().toString()).equals(txtPassword.getText().toString())){
           Toast.makeText(SampleLogin.this, "Login Successful",Toast.LENGTH_LONG).show();
          } else{
           Toast.makeText(SampleLogin.this, "Invalid Login",Toast.LENGTH_LONG).show();
          }

   }
  });       
    }
} 
</code></pre>

<p>My XML file...</p>

<pre><code>&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1"&gt;

&lt;TableRow&gt; 
 &lt;TextView 
 android:text="@string/User_Name: " 
 android:id="@+id/TextView01" 
 android:layout_width="wrap_content" 
 android:layout_height="wrap_content"&gt;
 &lt;/TextView&gt;

 &lt;EditText 
 android:inputType="textPassword|number"
 android:text="" 
 android:id="@+id/txtUname" 
 android:layout_width="fill_parent" 
 android:layout_height="wrap_content"&gt;

 &lt;/EditText&gt;
&lt;/TableRow&gt;


&lt;TableRow&gt;
 &lt;TextView 
 android:text="@string/Password: " 
 android:id="@+id/TextView02" 
 android:layout_width="wrap_content" 
 android:layout_height="wrap_content"&gt;
 &lt;/TextView&gt;


 &lt;EditText 
 android:inputType="textPassword|number" 
 android:text="" 
 android:id="@+id/txtPwd" 
 android:layout_width="fill_parent" 
 android:layout_height="wrap_content"  /&gt;

&lt;/TableRow&gt;


&lt;TableRow&gt;
 &lt;Button
 android:text="@string/Cancel" 
 android:id="@+id/btnCancel" 
 android:layout_width="fill_parent" 
 android:layout_height="wrap_content"&gt;
 &lt;/Button&gt;


 &lt;Button
 android:text="@string/Login" 
 android:id="@+id/btnLogin" 
 android:layout_width="fill_parent" 
 android:layout_height="wrap_content"&gt;
 &lt;/Button&gt;


&lt;/TableRow&gt;


&lt;/TableLayout&gt;
</code></pre>

<p>So here is my code for some reason the application stops working when I open it, the "application () has stopped unexpectedly. please try again avd... " I have no idea why that is happening, help please!</p>

<p>I'm new to android, can someone tell me how do I get the catlog file?</p>

<p>About the Strings on the xml file, again I'm new to this, I was getting an error about "hard coded string" or something like that and it said I needed to add it to the strings file found in the res folder so I added the strings and then added the @string </p>

<p>CatLog File:</p>

<pre><code>12-28 17:36:50.883: E/Zygote(33): setreuid() failed. errno: 2
12-28 17:37:00.573: E/Zygote(33): setreuid() failed. errno: 17
12-28 17:37:01.933: E/BatteryService(61): usbOnlinePath not found
12-28 17:37:01.933: E/BatteryService(61): batteryVoltagePath not found
12-28 17:37:01.933: E/BatteryService(61): batteryTemperaturePath not found
12-28 17:37:01.953: E/SurfaceFlinger(61): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
12-28 17:37:02.173: E/SensorService(61): couldn't open device for module sensors (Invalid argument)
12-28 17:37:06.682: E/System(61): Failure starting core service
12-28 17:37:06.682: E/System(61): java.lang.SecurityException
12-28 17:37:06.682: E/System(61):   at android.os.BinderProxy.transact(Native Method)
12-28 17:37:06.682: E/System(61):   at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
12-28 17:37:06.682: E/System(61):   at android.os.ServiceManager.addService(ServiceManager.java:72)
12-28 17:37:06.682: E/System(61):   at com.android.server.ServerThread.run(SystemServer.java:206)
12-28 17:37:06.712: E/EventHub(61): could not get driver version for /dev/input/mouse0, Not a typewriter
12-28 17:37:06.712: E/EventHub(61): could not get driver version for /dev/input/mice, Not a typewriter
12-28 17:37:07.122: E/SoundPool(61): error loading /system/media/audio/ui/Effect_Tick.ogg
12-28 17:37:07.122: E/SoundPool(61): error loading /system/media/audio/ui/KeypressStandard.ogg
12-28 17:37:07.122: E/SoundPool(61): error loading /system/media/audio/ui/KeypressSpacebar.ogg
12-28 17:37:07.122: E/SoundPool(61): error loading /system/media/audio/ui/KeypressDelete.ogg
12-28 17:37:07.122: E/SoundPool(61): error loading /system/media/audio/ui/KeypressReturn.ogg
12-28 17:37:07.164: E/UsbObserver(61): java.lang.NullPointerException
12-28 17:37:07.164: E/UsbObserver(61):  at com.android.server.UsbObserver.init(UsbObserver.java:131)
12-28 17:37:07.164: E/UsbObserver(61):  at com.android.server.UsbObserver.&lt;init&gt;(UsbObserver.java:65)
12-28 17:37:07.164: E/UsbObserver(61):  at com.android.server.ServerThread.run(SystemServer.java:402)
12-28 17:37:07.673: E/ThrottleService(61): Could not open GPS configuration file /etc/gps.conf
12-28 17:37:08.392: E/logwrapper(135): executing /system/bin/tc failed: No such file or directory
12-28 17:37:08.392: E/logwrapper(136): executing /system/bin/tc failed: No such file or directory
12-28 17:37:08.432: E/logwrapper(138): executing /system/bin/tc failed: No such file or directory
12-28 17:37:35.198: E/AndroidRuntime(335): FATAL EXCEPTION: main
12-28 17:37:35.198: E/AndroidRuntime(335): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.hi/com.example.hi.MainActivity}: java.lang.ClassNotFoundException: com.example.hi.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.hi-1.apk]
12-28 17:37:35.198: E/AndroidRuntime(335):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
12-28 17:37:35.198: E/AndroidRuntime(335):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
12-28 17:37:35.198: E/AndroidRuntime(335):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-28 17:37:35.198: E/AndroidRuntime(335):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
12-28 17:37:35.198: E/AndroidRuntime(335):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-28 17:37:35.198: E/AndroidRuntime(335):  at android.os.Looper.loop(Looper.java:123)
12-28 17:37:35.198: E/AndroidRuntime(335):  at android.app.ActivityThread.main(ActivityThread.java:3683)
12-28 17:37:35.198: E/AndroidRuntime(335):  at java.lang.reflect.Method.invokeNative(Native Method)
12-28 17:37:35.198: E/AndroidRuntime(335):  at java.lang.reflect.Method.invoke(Method.java:507)
12-28 17:37:35.198: E/AndroidRuntime(335):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-28 17:37:35.198: E/AndroidRuntime(335):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-28 17:37:35.198: E/AndroidRuntime(335):  at dalvik.system.NativeStart.main(Native Method)
12-28 17:37:35.198: E/AndroidRuntime(335): Caused by: java.lang.ClassNotFoundException: com.example.hi.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.hi-1.apk]
12-28 17:37:35.198: E/AndroidRuntime(335):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
12-28 17:37:35.198: E/AndroidRuntime(335):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
12-28 17:37:35.198: E/AndroidRuntime(335):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
12-28 17:37:35.198: E/AndroidRuntime(335):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
12-28 17:37:35.198: E/AndroidRuntime(335):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
12-28 17:37:35.198: E/AndroidRuntime(335):  ... 11 more
12-28 17:38:05.517: E/AndroidRuntime(344): FATAL EXCEPTION: main
12-28 17:38:05.517: E/AndroidRuntime(344): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.hi/com.example.hi.MainActivity}: java.lang.ClassNotFoundException: com.example.hi.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.hi-1.apk]
12-28 17:38:05.517: E/AndroidRuntime(344):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
12-28 17:38:05.517: E/AndroidRuntime(344):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
12-28 17:38:05.517: E/AndroidRuntime(344):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-28 17:38:05.517: E/AndroidRuntime(344):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
12-28 17:38:05.517: E/AndroidRuntime(344):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-28 17:38:05.517: E/AndroidRuntime(344):  at android.os.Looper.loop(Looper.java:123)
12-28 17:38:05.517: E/AndroidRuntime(344):  at android.app.ActivityThread.main(ActivityThread.java:3683)
12-28 17:38:05.517: E/AndroidRuntime(344):  at java.lang.reflect.Method.invokeNative(Native Method)
12-28 17:38:05.517: E/AndroidRuntime(344):  at java.lang.reflect.Method.invoke(Method.java:507)
12-28 17:38:05.517: E/AndroidRuntime(344):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-28 17:38:05.517: E/AndroidRuntime(344):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-28 17:38:05.517: E/AndroidRuntime(344):  at dalvik.system.NativeStart.main(Native Method)
12-28 17:38:05.517: E/AndroidRuntime(344): Caused by: java.lang.ClassNotFoundException: com.example.hi.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.hi-1.apk]
12-28 17:38:05.517: E/AndroidRuntime(344):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
12-28 17:38:05.517: E/AndroidRuntime(344):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
12-28 17:38:05.517: E/AndroidRuntime(344):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
12-28 17:38:05.517: E/AndroidRuntime(344):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
12-28 17:38:05.517: E/AndroidRuntime(344):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
12-28 17:38:05.517: E/AndroidRuntime(344):  ... 11 more
</code></pre>

<p>It doesn't crash anymore but I can't type anything!! I changed something on the xml file about typing because it was giving me a problem </p>

<pre><code>android:inputType="textPassword|number"
</code></pre>

<p>I think it was this but when I try to type something it does nothing!</p>

<p>Is this supposed to work?</p>

<pre><code>&lt;EditText 
 android:inputType="textPassword|number" 
 android:text="" 
 android:id="@+id/txtPwd" 
 android:layout_width="fill_parent" 
 android:layout_height="wrap_content"  /&gt;


 &lt;EditText 
 android:inputType="textPassword|number"
 android:text="" 
 android:id="@+id/txtUname" 
 android:layout_width="fill_parent" 
 android:layout_height="wrap_content" /&gt;
</code></pre>
