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

The Archive Base Latest Questions

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

This is a very basic question, I know, but I cannot seem to figure

  • 0

This is a very basic question, I know, but I cannot seem to figure it out on my own. While the Android tutorial will help you make a practice app, it does not really tell you what you are doing. (I have already successfully completed their tutorial.) All of my searches have come up with less newbish questions without answering my question. So here is my beginner’s question:

I want to display the text “Sup World.” What am I doing wrong? I am sure the null is wrong, but I cannot figure out what should actually be there. “this” does not work. And with null in there, setContextView does not exist.

package com.evorlor.testcode;

import android.widget.TextView;

public class SupWorld {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

        String message = "Sup world.";

        TextView textView = new TextView(null);
        textView.setTextSize(40);
        textView.setText(message);

        setContentView(textView);

    }

}

My issue is not in getting to my SupWorld class, is it?:

package com.evorlor.testcode;

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

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Intent intent = new Intent(this, SupWorld.class);
        startActivity(intent);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

}
  • 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-15T16:42:13+00:00Added an answer on June 15, 2026 at 4:42 pm

    Change your Code as:

    public class SupWorld extends Activity {
    
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
    
             String message = "Sup world.";
    
            TextView textView = new TextView(this);
            textView.setTextSize(40);
            textView.setText(message);
    
            setContentView(textView);
    
        }
    
    }
    

    Declares above activity class in AndroidManifest.xml :

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".MainActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:label="@string/app_name"
            android:name=".SupWorld" >
        </activity>
    </application>
    

    apart this you will to look some good tutorials for Creating your first application in android see these

    http://www.mkyong.com/android/android-activity-from-one-screen-to-another-screen/

    http://developer.android.com/training/basics/firstapp/index.html

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

Sidebar

Related Questions

Ok, I know this is a very basic question, but my head is swimming
I know, this might be a very basic question but I am not 100%
guys I know this question is very basic but I've met in few publications
I know this is a very basic question but when I compile my c/c++
I know this is a very basic question - but I did not face
I know this is a very simple and basic question but I would like
This is a very basic html question, but I can't seem to locate the
I know this is a very basic question, but I haven't been able to
I know this may be a very basic question, sorry if it is but
I know this is very basic question, but I need to know, how I

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.