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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:54:19+00:00 2026-05-22T17:54:19+00:00

hi i would like to know how to i go to the next layout

  • 0

hi i would like to know how to i go to the next layout on android. i am new to designing apps and i managed to have main.xml with a button that has onclicklistener and r.layout.second.xml, that is done. now when i am at second.xml, i want to go to third.xml, however, when i click the button on the third.xml, it does nothing.

i have added a new activity.java with roughly the same code as the main.java file with exception that setContentView(R.layout.second);

i have added new activity to manifest however, when i reach the second.xml, i cannot click to third.xml.

any help please.

  • 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-22T17:54:20+00:00Added an answer on May 22, 2026 at 5:54 pm

    Layouts as you refer to them are tied to Activities (you can tie several layouts to a single activity by using ViewFlipper though).

    What you’re looking for is not to go to the second layout, but rather to move to the next activity.

    You might have a button, where onClick executes the code to move to the next activity.

    You’ll need to use Intents to start a new activity, e.g.:

    Intent nextActivity = new Intent(this, SecondActivity.class);
    startActivity(nextActivity);
    

    This will start the new activity, and by extension, use the second layout you’re after.

    As a test run, if you don’t want to add a button yet, you could use the above code in your onCreate method, though it’ll appear as though it’s opened the second activity immediately. In reality, it’ll open the first, and start the second before you can see it; you can press back on your device to show that the first activity was, in fact, created.

    HTH

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

Sidebar

Related Questions

I would like to know whether it's possible to have something like this next
I would like to know how. I have looked at this topic , and
I would like to know that how we can check the available memory in
I would like to know the best way to have my header float right
For the Android application I am currently creating I would like to have a
I would like to know the best way to add a next and back
I would like to know if/how I can make vim look for the next
i would like know some reference. I know i can googling it. but prefer
Would like to know what a programmer should know to become a good at
Would like to know the c# code to actually retrieve the IP type: Static

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.