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

  • Home
  • SEARCH
  • 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 5974471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:56:53+00:00 2026-05-22T20:56:53+00:00

I have two activities and the first is generating properly however the second is

  • 0

I have two activities and the first is generating properly however the second is not. only the first element in the xml file will show up. here is my xml file:

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/alternateActivity"
    android:shadowColor="@color/shadowColor"></TextView>
<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/oldActivityButton"
    android:text="@string/oldActivityButton"></Button>
<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/changeText"
    android:text="@string/changeTextButton"></Button>
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/originalText" 
    android:id="@+id/textToChange"></TextView>
</LinearLayout>

and here is my activity that corresponds:

package fsg.dev.activitytest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class newActivity extends Activity {
private Button oldActivityButton;
private Button changeText;
private TextView textToChange;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.alternate);

        oldActivityButton = (Button) findViewById(R.id.oldActivityButton);
        changeText = (Button) findViewById(R.id.changeText);
        textToChange = (TextView) findViewById(R.id.textToChange);

        oldActivityButton.setOnClickListener(new OnClickListener(){
        public void onClick(View view){
            changeActivity();
        }
        });
        changeText.setOnClickListener(new OnClickListener(){
        public void onClick(View view){
            changeText();
        }
        });
    }

    private void changeActivity(){
        Intent i = new Intent(this, activityTest.class);
        startActivity(i);
    }

    private void changeText(){
        if(textToChange.equals(R.string.originalText)){
        textToChange.setText(R.string.newText);
        } else {
        textToChange.setText(R.string.originalText);
        }
    }
}

has anyone else seen this problem? or know of a way to fix it?

  • 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-22T20:56:54+00:00Added an answer on May 22, 2026 at 8:56 pm

    Try to add android:orientation=”vertical” to your LinearLayout

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

Sidebar

Related Questions

I have two different activities. The first launches the second one. In the second
I have two activities. The first activity display list of the users with short
I have two activities or screens. The second activity has an AlertDialogBox with radiobuttons
I have two Activities: one with VideoView attached to MediaPlayer and the second one.
I have two activities The first one gets some data from a content provider,
I have two activities, activity 1 and activity 2 for example. Activity 1 will
I'm writing an application which will have two Activities, when the user presses the
In my project I have two activities or classes. In first activity I have
I have two Sharepoint lists: - Assignments - Activities The activities list has a
I have two applications written in Java that communicate with each other using XML

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.