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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:12:19+00:00 2026-06-10T16:12:19+00:00

Okay, so I decided to take the Google classes for learning droid devving. I

  • 0

Okay, so I decided to take the Google classes for learning droid devving. I decided instead of the simple input box and button I would make multiple ones, and have each display a set color. The issue is it is jamming all input boxes on one line, rather than their own separate lines. This is what I have in the activity_color.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" 
android:orientation="horizontal" >

<EditText android:id="@+id/edit_message_blue"
    android:layout_width="0dp"
    android:layout_height="wrap_content" 
    android:layout_weight="1"
    android:hint="@string/edit_message_blue" />


<Button 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_send_blue" 
    android:onClick="sendMessageBlue" />

<EditText android:id="@+id/edit_message_orange"
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_weight="1"
    android:hint="@string/edit_message_orange" />

<Button 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:text="@string/button_send_orange" 
    android:onClick="sendMessageOrange" />

</LinearLayout>

This is the main java class

package com.example.color.texts;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class ColorTexts extends Activity {
public final static String EXTRA_MESSAGE = "com.example.colortexts.MESSAGE";

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

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_color_texts, menu);
    return true;
}

/** Called when the user clicks the Send button for Blue */
public void sendMessageBlue(View view) {
    Intent intent = new Intent (this, DisplayMessageActivity.class);
    EditText editText = (EditText) findViewById(R.id.edit_message_blue);
    String message = editText.getText().toString();
    intent.putExtra(EXTRA_MESSAGE, message);
    startActivity(intent);
}

/** Called when the user clicks the Send button for Red */
public void sendMessageRed(View view) {
    Intent intent = new Intent (this, DisplayMessageActivityRed.class);
    EditText editText = (EditText) findViewById(R.id.edit_message_red);
    String message = editText.getText().toString();
    intent.putExtra(EXTRA_MESSAGE, message);
    startActivity(intent);
}


/** Called when the user clicks the Send button for Orange */
public void sendMessageOrange(View view) {
    Intent intent = new Intent (this, DisplayMessageActivityOrange.class);
    EditText editText = (EditText) findViewById(R.id.edit_message_orange);
    String message = editText.getText().toString();
    intent.putExtra(EXTRA_MESSAGE, message);
    startActivity(intent);

}
}

Now I guess the question is how to either tell it to start a new line, like android:layout_next=”1″ or something (I KNOW THAT DOESN’T EXIST), or would I have to add to the public class? Such as make another layout file and reference to that? I highly doubt the latter would work.

EDIT: Per the instructions laid out, I think this is how I was supposed to do it, but it only know shows the first line 🙁

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" 
android:orientation="vertical" >

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="horizontal" 
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <EditText android:id="@+id/edit_message_blue"
    android:layout_width="0dp"
    android:layout_height="wrap_content" 
    android:layout_weight="1"
    android:hint="@string/edit_message_blue" />

<Button 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_send_blue" 
    android:onClick="sendMessageBlue" />

</LinearLayout>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >    

<EditText android:id="@+id/edit_message_red"
    android:layout_width="0dp" 
    android:layout_height="wrap_content"
    android:layout_weight="1" 
    android:hint="@string/edit_message_red" />

<Button 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:text="@string/button_send_red" 
    android:onClick="sendMessageRed" />

</LinearLayout>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

<EditText android:id="@+id/edit_message_orange"
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_weight="1"
    android:hint="@string/edit_message_orange" />

<Button 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:text="@string/button_send_orange" 
    android:onClick="sendMessageOrange" />

</LinearLayout>

</LinearLayout>
  • 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-10T16:12:20+00:00Added an answer on June 10, 2026 at 4:12 pm

    Your parent layout is set to be android:orientation="horizontal". This needs to be set to android:orientation="vertical".

    EDIT: Here is the reference in the Android docs:
    http://developer.android.com/reference/android/widget/LinearLayout.html#attr_android:orientation

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

Sidebar

Related Questions

Okay, I'm totally new to Python, so I decided to make a simple app.
Okay this question is very simple: I have a facebook page, and a website.
Okay, so I am a beginner at Cocoa and I've decided to try to
Okay, so I have a shopping cart problem. I've decided to roll out my
I decided to write a simple asm bootloader and a c++ kernel. I read
I'm a beginner programmer, I decided to write a simple program getting prime factors
Okay, so I need to create a 3D data-structure at run-time, I decided to
Okay simple question (I think). I have a DateTime field (auto_add_now) and when output
Okay getting some weirdness. I have a simple URLLoader in AS3 that loads an
I'm moving from StarTeam to SVN, and I've decided to take snapshots of each

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.