Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6792167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:56:09+00:00 2026-05-26T17:56:09+00:00

I am a beginner at writing android apps. Can you please help me how

  • 0

I am a beginner at writing android apps. Can you please help me how to deal with this problem. i have included the logcat entry and activity class.

log:

11-07 12:46:28.245: D/AndroidRuntime(579): Shutting down VM
11-07 12:46:28.245: W/dalvikvm(579): threadid=1: thread exiting with uncaught exception (group=0x40015560)
11-07 12:46:28.285: E/AndroidRuntime(579): FATAL EXCEPTION: main
11-07 12:46:28.285: E/AndroidRuntime(579): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.trial.login/com.trial.login.Login1Activity}: java.lang.NullPointerException
11-07 12:46:28.285: E/AndroidRuntime(579):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
11-07 12:46:28.285: E/AndroidRuntime(579):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
11-07 12:46:28.285: E/AndroidRuntime(579):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-07 12:46:28.285: E/AndroidRuntime(579):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-07 12:46:28.285: E/AndroidRuntime(579):  at android.os.Handler.dispatchMessage(Handler.java:99)
11-07 12:46:28.285: E/AndroidRuntime(579):  at android.os.Looper.loop(Looper.java:123)
11-07 12:46:28.285: E/AndroidRuntime(579):  at android.app.ActivityThread.main(ActivityThread.java:3683)
11-07 12:46:28.285: E/AndroidRuntime(579):  at java.lang.reflect.Method.invokeNative(Native Method)
11-07 12:46:28.285: E/AndroidRuntime(579):  at java.lang.reflect.Method.invoke(Method.java:507)
11-07 12:46:28.285: E/AndroidRuntime(579):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-07 12:46:28.285: E/AndroidRuntime(579):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-07 12:46:28.285: E/AndroidRuntime(579):  at dalvik.system.NativeStart.main(Native Method)
11-07 12:46:28.285: E/AndroidRuntime(579): Caused by: java.lang.NullPointerException
11-07 12:46:28.285: E/AndroidRuntime(579):  at com.trial.login.Login1Activity.onCreate(Login1Activity.java:28)
11-07 12:46:28.285: E/AndroidRuntime(579):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-07 12:46:28.285: E/AndroidRuntime(579):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
11-07 12:46:28.285: E/AndroidRuntime(579):  ... 11 more

LoginActivity.class:

    package com.trial.login;
    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.TextView;

    public class Login1Activity extends Activity {

            TextView username, password;
            EditText user_edit, pwd_edit;
            Button login, cancel;

                @Override
            public void onCreate(Bundle savedInstanceState) {

                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
                login = (Button) findViewById(R.id.bt1);
                cancel = (Button) findViewById(R.id.bt2);
                username = (TextView) findViewById(R.id.tv1);
                password = (TextView) findViewById(R.id.tv2);
                user_edit = (EditText) findViewById(R.id.txtUname);
                pwd_edit = (EditText) findViewById(R.id.txtPwd);

                login.setOnClickListener(new OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        display();
                    }
                });
            }
            cancel.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View arg0) {

                            user_edit.clearComposingText();
                    pwd_edit.clearComposingText();

                }
            }); 

            public void display(){

                String user_temp, pwd_temp;
            user_temp = user_edit.getText().toString();
            pwd_temp = pwd_edit.getText().toString();
            username.setText(user_temp);
            password.setText(pwd_temp);
            }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:56:10+00:00Added an answer on May 26, 2026 at 5:56 pm

    Try this:

    package com.trial.login;
        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.TextView;
    
        public class Login1Activity extends Activity {
    
                TextView username, password;
                EditText user_edit, pwd_edit;
                Button login, cancel;
    
                @Override
                public void onCreate(Bundle savedInstanceState) {
    
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.main);
                    login = (Button) findViewById(R.id.bt1);
                    cancel = (Button) findViewById(R.id.bt2);
                    username = (TextView) findViewById(R.id.tv1);
                    password = (TextView) findViewById(R.id.tv2);
                    user_edit = (EditText) findViewById(R.id.txtUname);
                    pwd_edit = (EditText) findViewById(R.id.txtPwd);
    
                    login.setOnClickListener(new OnClickListener() {
                        @Override
                        public void onClick(View arg0) {
                            display();
                        }
                    });
    
                     cancel.setOnClickListener(new OnClickListener() {
    
                        @Override
                        public void onClick(View arg0) {
    
                            user_edit.clearComposingText();
                            pwd_edit.clearComposingText();
    
                       }
                    }); 
                }
    
    
                public void display(){
    
                    String user_temp, pwd_temp;
                user_temp = user_edit.getText().toString();
                pwd_temp = pwd_edit.getText().toString();
                username.setText(user_temp);
                password.setText(pwd_temp);
                }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some beginner help needed if anybody can.. I'm writing a contact form with a
Absolute beginner question: I have a template file index.html that looks like this: ...
I'm a beginner when it comes to writing Mac apps and working with Cocoa,
Im still a beginner in C programming and I need a little help writing
I'm a VIM beginner, and I have a weird problem. I started using vim
I am beginner android developer.I am writing app witch write calls(incomming,outgoing,missed) to Android Calendar
being a regex beginner, I need some help writing a regex. It should match
sorry i'm a beginner and i can't determine how good a question this is,
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
Beginner help needed :) I am doign an example form a php book which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.