On 2/13/10, kamran Manzoor <[email protected]> wrote:
>
> ///////////////////////////////////////
> Salam to All
> I am trying to built the login screen, during this process i have a problem
> that
> package com.net.login;
>
> import android.app.Activity;
> import android.content.DialogInterface;
> import android.content.DialogInterface.OnClickListener;
> import android.os.Bundle;
> import android.view.View;
> import android.widget.Button;
> import android.widget.EditText;
> import android.widget.TextView;
>
> public class login extends Activity {
>     /** Called when the activity is first created. */
>  String username , password;
>     Button login;
>     TextView tv = new TextView(this);
>     EditText name = new EditText(this);
>     EditText pass =new EditText(this);
>  @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
>         //////////////////////////////////////////////
>
> //////////////////////////////////////////////
>         name = (EditText)findViewById(R.id.user_name);
>         pass = (EditText)findViewById(R.id.password);
>         login = (Button)this.findViewById(R.id.login);
> ////////////////////////////////////////////////////////
>         username = name.getText().toString();
>         password = pass.getText().toString();
>         login.setOnClickListener((android.view.View.OnClickListener)
> loginListener);
>     }
>     private OnClickListener loginListener = new OnClickListener()
>     {
>         public void onClick(View v)
>         {
>          if (username == "kami" && password == "kami")
>          {
>           //TextView tv = new TextView(this);
>                 tv.setText(" Login is Proved");
>                 setContentView(tv);
>
>           //System.out.println("login proved");
>          }
>          else
>          {
> //          TextView tv = new TextView(this);
>                 tv.setText(" Passwod is incorrect ");
>                 setContentView(tv);
>
>          }
>           //System.out.println("login proved");
>         }
>   @Override
>   public void onClick(DialogInterface dialog, int which) {
>    // TODO Auto-generated method stub
>
>   }
>
>     };
>
> }
> ///////////////////////////////////////////////////////////////////
>
>
emulator is stopped  forcely

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to