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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:17:00+00:00 2026-05-18T08:17:00+00:00

I’m very new to android development and I’m working on an application where I

  • 0

I’m very new to android development and I’m working on an application where I have 4 activities. Each activity needs to be able to navigate to any of the other 3. So I created 4 buttons at the top of each activity that allow for this. The XML code looks like this:

<Button ... android:onClick="loadProfileLayout"/>  
<Button ... android:onClick="loadRulesLayout"/>  
<Button ... android:onClick="loadSettingsLayout"/>  
<Button ... android:onClick="loadHelpLayout"/>

the manifest has an activity tag for each:

    <activity android:name=".Profiler" 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:name="Rules"></activity>
    <activity android:name="Settings"></activity>
    <activity android:name="Help"></activity>

And the functions called are these:

public void loadProfileLayout()        { startActivity(new Intent(this, Profiler.class)); }
public void loadRulesLayout(View v)    { startActivity(new Intent(this, Rules.class)); }
public void loadSettingsLayout(View v) { startActivity(new Intent(this, Settings.class)); }
public void loadHelpLayout(View v)   { startActivity(new Intent(this, Help.class)); }

So initially this works. From the main “Profile” activity I am able to navigate to any of the other 3. And from the other 3 I can navigate anywhere but back to the main one. When I press the main activity button the application crashes. I try and debug, but it doesn’t even appear to be executing loadProfileLayout(). Eclipse opens a “View.class” file with the contents of basically “Source not found”. If I press F8 to continue debugging it loads “ZygoteInit$MethodAndArgsCaller.run()”… again, “Source not found”. Pressing F8 again will load the error message in the emulator “Sorry! The application has stopped unexpectedly. Please try again.”

Again, I am new to Android and all I know of activities is what I’ve been reading on the dev website. Am I making a fundamental mistake here I am not aware of?

Thanks,
Nate

  • 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-05-18T08:17:00+00:00Added an answer on May 18, 2026 at 8:17 am

    I’m not sure if this was a typo in your question, but loadProfileLayout() also needs to take a View as its only parameter:

    public void loadProfileLayout(View v)
    

    Edit: The View parameter is the View that caused the onClick event (in your case, the Button instance). I haven’t looked at the code, but I assume that View is using reflection to find the method to call (specifically one that takes a View as an argument), and since it doesn’t find a matching method, it decides to throw an exception.

    • 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&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Basically, what I'm trying to create is a page of div tags, each has
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 a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.