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 7961695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:07:11+00:00 2026-06-04T05:07:11+00:00

I’m getting a crash with a nullpointer expection. I’m getting the suer to sign

  • 0

I’m getting a crash with a nullpointer expection. I’m getting the suer to sign up and I’m not sure if it’s my backend that’s failing. I’ve pointed my app to my php file and I’ve checked my Apache log and it is getting there.

code:

signUpButton.setOnClickListener(new OnClickListener(){
        public void onClick(View arg0) 
        {                       
        if (usernameText.length() > 0 &&        
                        passwordText.length() > 0 && 
                        passwordAgainText.length() > 0 &&
                        eMailText.length() > 0
                        )
                    {
                        //TODO check email adress is valid

                        if (passwordText.getText().toString().equals(passwordAgainText.getText().toString())){

                            if (usernameText.length() >= 5 && passwordText.length() >= 5) {

                                    Thread thread = new Thread(){
                                        String result = new String();
                                        @Override
                                        public void run() {
                                            result = imService.signUpUser(usernameText.getText().toString(), 
                                                    passwordText.getText().toString(), 
                                                    eMailText.getText().toString());

                                            handler.post(new Runnable(){

                                                public void run() {
                                                    if (result.equals(SERVER_RES_RES_SIGN_UP_SUCCESFULL)) {
                                                        showDialog(SIGN_UP_SUCCESSFULL);
                                                    }
                                                    else if (result.equals(SERVER_RES_SIGN_UP_USERNAME_CRASHED)){
                                                        showDialog(SIGN_UP_USERNAME_CRASHED);
                                                    }
                                                    else  if (result.equals(SERVER_RES_SIGN_UP_FAILED)) 
                                                    {
                                                        showDialog(SIGN_UP_FAILED);
                                                    }           
                                                }

                                            });
                                        }

                                    };
                                    thread.start();
                            }
                            else{
                                showDialog(USERNAME_AND_PASSWORD_LENGTH_SHORT);
                            }                           
                        }
                        else {
                            showDialog(TYPE_SAME_PASSWORD_IN_PASSWORD_FIELDS);
                        }

                    }
                    else {
                        showDialog(FILL_ALL_FIELDS);

                    }               
                }           
            });

            cancelButton.setOnClickListener(new OnClickListener(){
                public void onClick(View arg0) {
                Toast.makeText(getApplicationContext(), "Sorry! Please try again.", Toast.LENGTH_SHORT).show();
                {                   
                }               
            }});


        }


    protected Dialog onCreateDialog(int id) 
    {       

        switch (id) 
        {
            case TYPE_SAME_PASSWORD_IN_PASSWORD_FIELDS:         
                return new AlertDialog.Builder(SignUp.this)       
                .setMessage(R.string.signup_type_same_password_in_password_fields)
                .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        /* User clicked OK so do some stuff */
                    }
                })        
                .create();          
            case FILL_ALL_FIELDS:               
                return new AlertDialog.Builder(SignUp.this)       
                .setMessage(R.string.signup_fill_all_fields)
                .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        /* User clicked OK so do some stuff */
                    }
                })        
                .create();
            case SIGN_UP_FAILED:
                return new AlertDialog.Builder(SignUp.this)       
                .setMessage(R.string.signup_failed)
                .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        /* User clicked OK so do some stuff */
                    }
                })        
                .create();
            case SIGN_UP_USERNAME_CRASHED:
                return new AlertDialog.Builder(SignUp.this)       
                .setMessage(R.string.signup_username_crashed)
                .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        /* User clicked OK so do some stuff */
                    }
                })        
                .create();
            case SIGN_UP_SUCCESSFULL:
                return new AlertDialog.Builder(SignUp.this)       
                .setMessage(R.string.signup_successfull)
                .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        finish();
                    }
                })        
                .create();  
            case USERNAME_AND_PASSWORD_LENGTH_SHORT:
                return new AlertDialog.Builder(SignUp.this)       
                .setMessage(R.string.username_and_password_length_short)
                .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        /* User clicked OK so do some stuff */
                    }
                })        
                .create();
            default:
                return null;

        }


    }

    @Override
    protected void onResume() {
        bindService(new Intent(SignUp.this, IMService.class), mConnection , Context.BIND_AUTO_CREATE);

        super.onResume();
    }

    @Override
    protected void onPause() 
    {
        unbindService(mConnection);
        super.onPause();
    }



}

LogCat:
05-21 13:47:22.237: E/AndroidRuntime(522): FATAL EXCEPTION: main

05-21 13:47:22.237: E/AndroidRuntime(522): java.lang.NullPointerException 

05-21 13:47:22.237: E/AndroidRuntime(522):  at com.mekya.SignUp$2$1$1.run(SignUp.java:113) 

05-21 13:47:22.237: E/AndroidRuntime(522):  at android.os.Handler.handleCallback(Handler.java:587) 

05-21 13:47:22.237: E/AndroidRuntime(522):  at android.os.Handler.dispatchMessage(Handler.java:92) 

05-21 13:47:22.237: E/AndroidRuntime(522):  at android.os.Looper.loop(Looper.java:123) 05-21 13:47:22.237: E/AndroidRuntime(522):   at android.app.ActivityThread.main(ActivityThread.java:4627) 

05-21 13:47:22.237: E/AndroidRuntime(522):  at java.lang.reflect.Method.invokeNative(Native Method) 

05-21 13:47:22.237: E/AndroidRuntime(522):  at java.lang.reflect.Method.invoke(Method.java:521) 

05-21 13:47:22.237: E/AndroidRuntime(522):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 05-21 13:47:22.237: E/AndroidRuntime(522):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 

05-21 13:47:22.237: E/AndroidRuntime(522):  at dalvik.system.NativeStart.main(Native Method)
  • 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-04T05:07:13+00:00Added an answer on June 4, 2026 at 5:07 am

    Looks like result is null ….

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.