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

  • Home
  • SEARCH
  • 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 8037185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:51:08+00:00 2026-06-05T02:51:08+00:00

I am making an android app using android 2.2 and eclipse. There are two

  • 0

I am making an android app using android 2.2 and eclipse.

There are two workflows of the app:

WF1: CoverPageApp -> LoginActivity -> Dashboard.

WF2: CoverPageApp -> RegisterActivity -> Dashboard.

But as I click on the Start Button in CoverPageApp to go on another activity, i.e LoginActivity, the app force closes.
I have also included the LogCat which shows error of Null Exception and in the LoginActivity Java File it points on the line 51:
btnLinkToRegistrScrn = (Button) findViewById(R.id.LinkToRegisterScreen);

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.app.android"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:targetSdkVersion="15" android:minSdkVersion="8" />

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

        <activity
            android:enabled="true"
            android:name=".PageApp"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity 
            android:enabled="true"
            android:name=".LoginActivity1"
            android:label="Login Activity" >
        </activity>

        <activity
            android:enabled="true"
            android:name=".CAActivity"
            android:label="Register Activity" >
        </activity>

        <activity
            android:enabled="true"
            android:name=".DashboardActivity"
            android:label="Dashboard Activity" >
        </activity>

    </application>

  </manifest>

PageApp.java

import android.app.Activity;
import android.os.Bundle;
//import android.content.Context;
import android.content.Intent;
import android.widget.Button;
import android.view.View;

public class PageApp extends Activity {

    Button startbutton;

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


    public void addListenerOnButton() {

        //final Context context1 = this;

        startbutton = (Button) findViewById(R.id.button1);

        startbutton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                Intent intent1 = new Intent(arg0.getContext(), LoginActivity1.class); 
            //    intent1.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent1); 
                finish();
                }
            });

    }

}

Log.java

import android.app.Activity;
//import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
//import android.view.View.OnClickListener;
import android.widget.Button;
//import android.widget.TextView;


public class Log extends Activity {

    Button btnLinkToRegistrScrn;
    Button loginbtn1;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
     setContentView(R.layout.login);
     addListenerOnButton();
//     btnLinkToRegistrScrn = (Button) findViewById(R.id.LinkToRegisterScreen); 

   }


    public void addListenerOnButton() {

        //final Context context2 = this;

            loginbtn1 = (Button) findViewById(R.id.btnLogin);

            loginbtn1.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {

                Intent intent = new Intent(arg0.getContext(), DashboardActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                         startActivity(intent);   
            }

        });
    }


    { 
        // Link to Register Screen 
        btnLinkToRegistrScrn = (Button) findViewById(R.id.LinkToRegisterScreen); 
        btnLinkToRegistrScrn.setOnClickListener(new View.OnClickListener() { 
           @Override
            public void onClick(View v) { 
                Intent i = new Intent(v.getContext(), CAaactivity.class); 
              //  i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(i);
                } 
       }); 

    }   

   }

LOGCAT

05-31 17:53:19.691: D/AndroidRuntime(1958): Shutting down VM
05-31 17:53:19.710: W/dalvikvm(1958): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-31 17:53:19.730: E/AndroidRuntime(1958): FATAL EXCEPTION: main
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.os.Looper.loop(Looper.java:123)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.app.ActivityThread.main(ActivityThread.java:4627)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at java.lang.reflect.Method.invokeNative(Native Method)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at java.lang.reflect.Method.invoke(Method.java:521)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at dalvik.system.NativeStart.main(Native Method)
05-31 17:53:19.730: E/AndroidRuntime(1958): Caused by: java.lang.NullPointerException
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.app.Activity.findViewById\untime(1958):  at java.lang.Class.newInstanceImpl(Native Method)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at java.lang.Class.newInstance(Class.java:1429)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-31 17:53:19.730: E/AndroidRuntime(1958):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
05-31 17:53:19.730: E/AndroidRuntime(1958):     ... 11 more
  • 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-06-05T02:51:10+00:00Added an answer on June 5, 2026 at 2:51 am

    Change Your LoginActivity1 Activity as:

    public class LoginActivity1 extends Activity {
    
        Button btnLinkToRegistrScrn;
        Button loginbtn1;
    
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
         setContentView(R.layout.login);
         addListenerOnButton();
            // Link to Register Screen 
            btnLinkToRegistrScrn = (Button) findViewById(R.id.LinkToRegisterScreen); 
            btnLinkToRegistrScrn.setOnClickListener(new View.OnClickListener() { 
               @Override
                public void onClick(View v) { 
                    Intent i = new Intent(v.getContext(), TrekEyesAndroidActivity.class); 
                  //  i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                    startActivity(i);
                    } 
           }); 
       }
        public void addListenerOnButton() {
    
            //final Context context2 = this;
    
                loginbtn1 = (Button) findViewById(R.id.btnLogin);
    
                loginbtn1.setOnClickListener(new View.OnClickListener() {
    
                @Override
                public void onClick(View arg0) {
    
                    Intent intent = new Intent(arg0.getContext(), DashboardActivity.class);
                    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                             startActivity(intent);   
                }
    
            });
        }
       }
    

    and in xml change TextView to Button as

    <Button
             android:id="@+id/LinkToRegisterScreen"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginTop="25dip"
    
                android:textColor="#21dbd4"
                android:textStyle="bold" 
                android:text="@string/noAccountRegisterME" />  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm making my first Android app, using ADT in Eclipse and working with
I have started making graphics for my Android app using Adobe Photoshop. But I
So I'm making an android app. I am using Eclipse. When I click on
I am making an android app using android 2.2 and eclipse. Its a simple
I'm making a simple drawing app on Android. I'm using the FingerPaint.java provided with
So I'm making an android app that has more than 100 buttons,but you know
I'm making a simple timer as a part of an Android app using a
Alright I am making an Android app, and using the CAPTURE_PIC_REQUEST to take a
Am making a basic phonegap based android app. All working perfectly and using localstorage
I'm making an Android app using Processing, and have decided to port my code

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.