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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:38:33+00:00 2026-06-12T15:38:33+00:00

I am new to android apps. I am using the netbeans 7.0.1 IDE to

  • 0

I am new to android apps. I am using the netbeans 7.0.1 IDE to develop android apps. I have written the following code in the main java file:

package com.test.helloworld;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;


public class helloworld extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
     TextView t1=new TextView(this);
    t1.setText("hello world..!!!!");
    setContentView(t1);
}

}

This was working fine.
I edited the main.xml file to display a textfield and button as follows:

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

>
    <Button  
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_send"/>

    <EditText android:id="@+id/edit_message"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:hint="@string/edit_message"/>

</LinearLayout> 

Of course I have added all the corresponding strings in strings.xml. But when I try to run my app these weren’t displaying… 🙁 . I mean the same string that was displayed previously was being displayed.

Can anybody figure out what is the mistake??

  • 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-12T15:38:34+00:00Added an answer on June 12, 2026 at 3:38 pm

    Remove below lines from onCreate method of your activity

    TextView t1=new TextView(this);
    t1.setText("hello world..!!!!");
    setContentView(t1);
    

    Because you are setting the contentView from the main.xml and then again you are creating the TextView dynamic and setting that TextView as a contentView. so you are getting the static string "hello world..!!!!"

    Edit

    There is a spelling mistake in your android:oreintation line which you are using for set orientation. use “android:orientation” instead.

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

Sidebar

Related Questions

I have begun evaluating MonoDroid. (I've built many apps using Android+Eclipse) I created new-from-template
I have been writing apps for my Droid x2 using the new Android update
I am learning how to develop Android apps, using Eclipse. New to all of
I have the code below which I am using from an Android java tutorial.
I'm new to android apps development and I have a basic sqlite question. What
i am creating a new android application.i am using the table layout. I have
In one of my apps I'm using the following code to issue a phone
I am using following code to invoke Barcode scanner apps from Zing public Button.OnClickListener
I have written a few Android apps, and have always declared a starting Activity
I'm new to developing apps in Android. We are currently creating a robot using

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.