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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:45:32+00:00 2026-06-08T02:45:32+00:00

I am trying to start an activity from an options menu, but my app

  • 0

I am trying to start an activity from an options menu, but my app keeps crashing. The only error that I receive is an ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,Intent) error in the debug window in Eclipse.

Below is the the code that I am using at the moment, but keep in mind I have tried multiple options, all of which end in the same misery, at the same piece of code – the startActivity statement (discovered by using breakpoints, since I’m not sure how to see the stack trace in the LogCat window, as described in my previous question Android/Eclipse: assistance with LogCat).

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    getMenuInflater().inflate(R.menu.changescheme, menu);
    menu.findItem(R.id.changeScheme).setIntent(new Intent(this, ColourActivity.class));
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    super.onOptionsItemSelected(item);
    this.closeOptionsMenu();
    startActivity(item.getIntent());
    return true;
}

And here is the changescheme.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/changeScheme" android:title="Change Colour Scheme" android:icon="@android:drawable/ic_menu_edit"></item>
</menu>

I have also tried using a switch(item.getItemId()) statement in the onOptionsItemSelected block as opposed to the menu.findItem in the onCreateOptionsMenu block, but still no luck.

I have defined the activity in my Manifest file. I can also start the activity from a regular button, and the first time the app opens on a device, the activity is started immediately after my splash screen, and I have had no problems with either of these methods.

To me this indicates that there is nothing wrong with the ColourActivity class or its associated layout file, but there is a problem with the implementation from the options menu.

I have also implemented this same method as shown above (in code) in a different app and had no problems, so I’m am really at a loss here.

  • 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-08T02:45:34+00:00Added an answer on June 8, 2026 at 2:45 am

    I have solved the problem now.

    It turns out the problem was not at all on the ListActivity class, it was in fact on the ColourActivity class.

    I was attempting to parse a few colours in onCreate, but I had forgotten to include the # in one of the RGB colour strings, hence the crash!

    Thanks heaps for everyone’s help, Adam.

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

Sidebar

Related Questions

I am trying to start service from AsyncTask but cant see that its starts.
I'm trying to start an activity from a service running in background but its
I'm trying to start an Activity in my AsyncTask from the doInBackground() method but
I am trying to manage the activity indicator from my App Delegate, that way
i'm trying to start a map activity from a normal Activity. But keep getting
I am trying to start an activity from the notification bar but it needs
I am trying to start the main activity from inside a BroadcastReceiver. I dont
I'm trying to start a phantomjs process from python but for some reason it's
I'm trying to start a Skype intent from my Android App, passing a phone
I am trying to start an activity from my main activity. Its not working

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.