android application crashes when button is clicked
<p>I am writing an android application that check the username and the password of the user once a login button is clicked</p>

<p>i run the app in the emulator and when i click on login button the application is crashed</p>

<pre><code>package com.google.android.InitialScreen;

import android.app.TabActivity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TabHost;


public class InitialScreen extends TabActivity implements View.OnClickListener {


    EditText username; 
    EditText password;
    Button login;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        username = (EditText) findViewById(R.id.usernamefield);
        password = (EditText) findViewById(R.id.passwordfield);

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TabHost mTabHost = getTabHost();

        mTabHost.addTab(mTabHost.newTabSpec("tab_test1")
                .setIndicator("TAB 1")
                .setContent(R.id.tabview1));

        this.login = (Button)findViewById(R.id.login);

        this.login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if ((username.getText().length()==0)&amp;&amp;(password.getText().length()==0))
                    username.setText("u&amp;p");
//                    Toast.makeText(getApplicationContext(), "Please Enter Username and Password", Toast.LENGTH_SHORT).show();
                else if ((username.getText().length()==0)){
                    username.setText("u");
//                    Toast.makeText(getApplicationContext(), "Please Enter Username", Toast.LENGTH_SHORT).show();
                }
                else if (password.getText().length()==0)
                    username.setText("p");
                else 
                    username.setText("ok");
            }
        });
              mTabHost.addTab(mTabHost.newTabSpec("tab_test2")
                .setIndicator("TAB 2")
                .setContent(R.id.tabview2));

              mTabHost.setCurrentTab(0);
    }
}
</code></pre>

<p>please i am looking for your assistance </p>

<p>thanks in advanced </p>
