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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:12:19+00:00 2026-06-05T09:12:19+00:00

Here is the code. It doesn’t give any error in console. I have made

  • 0

Here is the code. It doesn’t give any error in console. I have made another activity class test_me.java. When I click on the dialog option, it gives the error that ” Unfortunately the app stopped working”. Please tell me what is the problem here.

 public class TestActivity extends Activity {

    Context context=this;
    Intent testIntent;
        Intent progIntent;
        Intent settingIntent;
        Intent resultIntent; public void onCreate(Bundle icicle) {
            super.onCreate(icicle);
            setContentView(R.layout.main);  
            Button b1 = (Button)findViewById(R.id.button1);        
            b1.setOnClickListener(new Button.OnClickListener(){

        @Override
         public void onClick(View v) {
                  if(v.getId()==R.id.button1)
                  {                   final CharSequence[] items = {"Test", "ProgMode", "Settings","Result"};
                     AlertDialog.Builder builder = new AlertDialog.Builder(context)
                    .setTitle("Menu Options")
                  .setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
                         public void onClick(DialogInterface dialog, int item) {

                             if(items[item]=="Test")
                            {testIntent = new Intent(TestActivity.this, test_me.class);
                                startActivity(testIntent);
                                }
                             else if(items[item]=="ProgMode")
                                {progIntent = new Intent(TestActivity.this,prog_mode.class);
                                startActivity(progIntent);

                                    }
                             else if(items[item]=="Settings")
                                {settingIntent = new Intent(TestActivity.this,setting_mode.class);
                                startActivity(settingIntent);
                                                                }
                             else if(items[item]=="Results")
                                {
                                 resultIntent = new Intent(TestActivity.this,result_mode.class);
                                startActivity(resultIntent);
                                                                }

                             Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
                         }
                     });
                      builder.setPositiveButton("Back",
            new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();

                }
            });
}

Here is the Log

06-07 17:44:15.598: I/dalvikvm(654): threadid=3: reacting to signal 3
06-07 17:44:15.978: I/dalvikvm(654): Wrote stack traces to '/data/anr/traces.txt'
06-07 17:44:16.088: I/dalvikvm(654): threadid=3: reacting to signal 3
06-07 17:44:16.148: I/dalvikvm(654): Wrote stack traces to '/data/anr/traces.txt'
06-07 17:44:16.538: D/android.widget.GridLayout(654): vertical constraints: y3 - y0 > 637, y1 - y0 > 129, y2 - y1 > 135, y3 - y0 < 618 are inconsistent; permanently removing: y3 - y0 < 618. 
06-07 17:44:16.608: I/dalvikvm(654): threadid=3: reacting to signal 3
06-07 17:44:16.638: I/dalvikvm(654): Wrote stack traces to '/data/anr/traces.txt'
06-07 17:44:16.858: D/gralloc_goldfish(654): Emulator without GPU emulation detected.
06-07 17:44:17.108: I/dalvikvm(654): threadid=3: reacting to signal 3
06-07 17:44:17.139: I/dalvikvm(654): Wrote stack traces to '/data/anr/traces.txt'
06-07 17:44:21.638: D/AndroidRuntime(654): Shutting down VM
06-07 17:44:21.638: W/dalvikvm(654): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
06-07 17:44:21.688: E/AndroidRuntime(654): FATAL EXCEPTION: main
06-07 17:44:21.688: E/AndroidRuntime(654): android.content.ActivityNotFoundException: Unable to find explicit activity class {achira.test/achira.test.test_me}; have you declared this activity in your AndroidManifest.xml?
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1508)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.app.Activity.startActivityForResult(Activity.java:3190)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.app.Activity.startActivity(Activity.java:3297)
06-07 17:44:21.688: E/AndroidRuntime(654):  at achira.test.AchActivity$1$1.onClick(AchActivity.java:84)
06-07 17:44:21.688: E/AndroidRuntime(654):  at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:924)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.widget.AdapterView.performItemClick(AdapterView.java:292)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.widget.AbsListView.performItemClick(AbsListView.java:1058)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.widget.AbsListView$PerformClick.run(AbsListView.java:2514)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.widget.AbsListView$1.run(AbsListView.java:3168)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.os.Handler.handleCallback(Handler.java:605)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.os.Handler.dispatchMessage(Handler.java:92)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.os.Looper.loop(Looper.java:137)
06-07 17:44:21.688: E/AndroidRuntime(654):  at android.app.ActivityThread.main(ActivityThread.java:4424)
06-07 17:44:21.688: E/AndroidRuntime(654):  at java.lang.reflect.Method.invokeNative(Native Method)
06-07 17:44:21.688: E/AndroidRuntime(654):  at java.lang.reflect.Method.invoke(Method.java:511)
06-07 17:44:21.688: E/AndroidRuntime(654):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-07 17:44:21.688: E/AndroidRuntime(654):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-07 17:44:21.688: E/AndroidRuntime(654):  at dalvik.system.NativeStart.main(Native Method)
06-07 17:44:22.349: I/dalvikvm(654): threadid=3: reacting to signal 3
06-07 17:44:22.388: I/dalvikvm(654): Wrote stack traces to '/data/anr/traces.txt'
06-07 17:44:24.118: I/Process(654): Sending signal. PID: 654 SIG: 9
  • 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-05T09:12:20+00:00Added an answer on June 5, 2026 at 9:12 am

    i think this

    Context context=TestActivity.this;
    

    should come inside onCreate

    also dismiss your dialog

    reset your adb or restart your emulator you will get errors in logcat

    your logcat says

    E/AndroidRuntime(654): android.content.ActivityNotFoundException: Unable to find explicit activity class {achira.test/achira.test.test_me}; have you declared this activity in your AndroidManifest.xml?
    

    that means you haven’t declared your activities in manifest

    declare activity like this inside application tag

    <activity
                android:name=".test_me"
                android:label="@string/app_name">
            </activity>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code, which compiles but doesn't bring back any data. Here
I Have the following code which fires OnCreatedUser and doesn't throw any errors. Profile.Title
Here's what I'm trying to do -- this is pseudo code and doesn't work.
I want to disable <script> tags. Here's my code, but it doesn't work. document.getElementsByTagName('script').disabled
I have a piece of code here that does not work despite me using
I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does
I'm trying to call another jQuery function if confirm is true, here's the code:
UPDATE: I've posted the Renderer code below, since this code here doesn't seem to
I seem to have run into a peculiar problem. Here is the code #read
I was following this tutorial, bit stuck here: This code doesn't compile, and the

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.