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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:08:21+00:00 2026-06-08T03:08:21+00:00

I’m getting this error after clicking the AlertDialog box OK Button to Intent to

  • 0

I’m getting this error after clicking the AlertDialog box OK Button to Intent to the next activity, the data is still being inserted into the database but the application just crashes.

Logcat error:

07-22 02:26:08.603: E/JSON(10170): {"tag":"register","success":1,"error":0,"uid":"500af44ea075b5.28543539","user":{"name":"Dddds","email":"Saasa","imei":"359616041330986","created_at":"2012-07-22 02:26:22","updated_at":null}}
07-22 02:26:08.623: E/JSON(10170): {"uid":"500af44ea075b5.28543539","error":0,"user":{"created_at":"2012-07-22 02:26:22","updated_at":null,"email":"Saasa","imei":"359616041330986","name":"Dddds"},"success":1,"tag":"register"}
07-22 02:26:08.758: D/dalvikvm(10170): GC_CONCURRENT freed 142K, 3% free 13469K/13831K, paused 7ms+2ms
07-22 02:26:09.608: D/dalvikvm(10170): newInstance failed: p0 i0 [0 a1
07-22 02:26:09.608: D/AndroidRuntime(10170): Shutting down VM
07-22 02:26:09.608: W/dalvikvm(10170): threadid=1: thread exiting with uncaught exception (group=0x40c681f8)
07-22 02:26:09.613: E/AndroidRuntime(10170): FATAL EXCEPTION: main
07-22 02:26:09.613: E/AndroidRuntime(10170): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{nyp.android.project/nyp.android.project.DashboardActivity}: java.lang.InstantiationException: can't instantiate class nyp.android.project.DashboardActivity
07-22 02:26:09.613: E/AndroidRuntime(10170):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1891)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at android.app.ActivityThread.access$600(ActivityThread.java:127)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at android.os.Looper.loop(Looper.java:137)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at android.app.ActivityThread.main(ActivityThread.java:4511)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at java.lang.reflect.Method.invokeNative(Native Method)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at java.lang.reflect.Method.invoke(Method.java:511)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at dalvik.system.NativeStart.main(Native Method)
07-22 02:26:09.613: E/AndroidRuntime(10170): Caused by: java.lang.InstantiationException: can't instantiate class nyp.android.project.DashboardActivity
07-22 02:26:09.613: E/AndroidRuntime(10170):    at java.lang.Class.newInstanceImpl(Native Method)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at java.lang.Class.newInstance(Class.java:1319)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at android.app.Instrumentation.newActivity(Instrumentation.java:1026)
07-22 02:26:09.613: E/AndroidRuntime(10170):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)
07-22 02:26:09.613: E/AndroidRuntime(10170):    ... 11 more
07-22 02:26:59.308: I/Process(10170): Sending signal. PID: 10170 SIG: 9
07-22 02:31:13.878: D/OpenGLRenderer(10938): Flushing caches (mode 0)
07-22 02:31:15.773: D/dalvikvm(10938): GC_CONCURRENT freed 155K, 3% free 13114K/13511K, paused 2ms+2ms
07-22 02:31:17.708: D/OpenGLRenderer(10938): Flushing caches (mode 0)
07-22 02:31:26.963: E/JSON(10938): {"tag":"register","success":1,"error":0,"uid":"500af58d0aa288.05836094","user":{"name":"Test","email":"Test","imei":"359616041330986","created_at":"2012-07-22 02:31:41","updated_at":null}}
07-22 02:31:26.968: E/JSON(10938): {"uid":"500af58d0aa288.05836094","error":0,"user":{"created_at":"2012-07-22 02:31:41","updated_at":null,"email":"Test","imei":"359616041330986","name":"Test"},"success":1,"tag":"register"}
07-22 02:31:27.008: D/dalvikvm(10938): GC_FOR_ALLOC freed 214K, 3% free 13240K/13639K, paused 20ms
07-22 02:31:28.468: D/dalvikvm(10938): newInstance failed: p0 i0 [0 a1
07-22 02:31:28.468: D/AndroidRuntime(10938): Shutting down VM
07-22 02:31:28.468: W/dalvikvm(10938): threadid=1: thread exiting with uncaught exception (group=0x40c681f8)
07-22 02:31:28.473: E/AndroidRuntime(10938): FATAL EXCEPTION: main
07-22 02:31:28.473: E/AndroidRuntime(10938): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{nyp.android.project/nyp.android.project.DashboardActivity}: java.lang.InstantiationException: can't instantiate class nyp.android.project.DashboardActivity
07-22 02:31:28.473: E/AndroidRuntime(10938):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1891)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at android.app.ActivityThread.access$600(ActivityThread.java:127)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at android.os.Looper.loop(Looper.java:137)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at android.app.ActivityThread.main(ActivityThread.java:4511)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at java.lang.reflect.Method.invokeNative(Native Method)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at java.lang.reflect.Method.invoke(Method.java:511)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at dalvik.system.NativeStart.main(Native Method)
07-22 02:31:28.473: E/AndroidRuntime(10938): Caused by: java.lang.InstantiationException: can't instantiate class nyp.android.project.DashboardActivity
07-22 02:31:28.473: E/AndroidRuntime(10938):    at java.lang.Class.newInstanceImpl(Native Method)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at java.lang.Class.newInstance(Class.java:1319)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at android.app.Instrumentation.newActivity(Instrumentation.java:1026)
07-22 02:31:28.473: E/AndroidRuntime(10938):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)
07-22 02:31:28.473: E/AndroidRuntime(10938):    ... 11 more

Code:

            JSONObject json = userFunction.registerUser(name, email, password, IMEI.getText().toString());

            // check for login response
            try {
                if (json.getString(KEY_SUCCESS) != null) {
                    registerErrorMsg.setText("");
                    String res = json.getString(KEY_SUCCESS); 
                    if(Integer.parseInt(res) == 1){
                        // user successfully registered
                        // Store user details in SQLite Database
                        DatabaseHandler db = new DatabaseHandler(getApplicationContext());
                        JSONObject json_user = json.getJSONObject("user");

                        AlertDialog alertDialog = new AlertDialog.Builder(RegisterActivity.this).create();

                        // Setting Dialog Title
                        alertDialog.setTitle("Registration");

                        // Setting Dialog Message
                        alertDialog.setMessage("Registration successful");

                        // Setting Icon to Dialog
                        alertDialog.setIcon(R.drawable.tick);

                        // Setting OK Button
                        alertDialog.setButton("OK", new DialogInterface.OnClickListener() {

                        public void onClick(DialogInterface dialog, int which) {
                        // Write your code here to execute after dialog closed
                        //Toast.makeText(getApplicationContext(), "You clicked on OK", Toast.LENGTH_SHORT).show();

                        // Launch Dashboard Screen
                        Intent dashboard = new Intent(getApplicationContext(), DashboardActivity.class);

                        // Close all views before launching Dashboard
                        dashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                        startActivity(dashboard);

                        // Close Registration Screen
                        finish();

                        }
                        });

                        // Showing Alert Message
                        alertDialog.show();     

                        // Clear all previous data in database
                        userFunction.logoutUser(getApplicationContext());
                        db.addUser(json_user.getString(KEY_NAME), json_user.getString(KEY_EMAIL), json.getString(KEY_UID), json_user.getString(KEY_CREATED_AT), json_user.getString(KEY_IMEI));                     

                    }else{
                        // Error in registration
                        registerErrorMsg.setText("Error occured in registration");
                    }
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    });
  • 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-08T03:08:22+00:00Added an answer on June 8, 2026 at 3:08 am

    I’ve never seen an intent created with getApplicationContext(). Did you try it using ClassName.this instead?

    Usually it is:

    Intent intent = new Intent(CurrentActivity.this, NextActivity.class);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
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 have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I want to construct a data frame in an Rcpp function, but when I

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.