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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:59:33+00:00 2026-06-14T11:59:33+00:00

Im attempting a tutorial for a second time and getting the same errors that

  • 0

Im attempting a tutorial for a second time and getting the same errors that i wasnt able to resolve. Im getting red underlines on MainActivityTextview.
I assigned a text box an id of “MainActivityTextview” and now im trying to set the text it it.
Simple right? But I cant get it to work. Am I missing an import?
Thanks

MainActivity.java

package com.Proteintracker;

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

public class MainActivity extends Activity {

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

    TextView textView = (TextView) findViewById(android.R.id.MainActivityTextview);
    textView.setText("hello world");
}


}

r.java

package com.Proteintracker;

public final class R {
public static final class attr {
}
public static final class drawable {
    public static final int ic_action_search=0x7f020000;
    public static final int ic_launcher=0x7f020001;
}
public static final class id {
    public static final int MainActivityTextview=0x7f070000;
    public static final int menu_settings=0x7f070001;
}
public static final class layout {
    public static final int activity_main=0x7f030000;
}
public static final class menu {
    public static final int activity_main=0x7f060000;
}
public static final class string {
    public static final int app_name=0x7f040000;
    public static final int hello_world=0x7f040001;
    public static final int menu_settings=0x7f040002;
    public static final int title_activity_main=0x7f040003;
}
public static final class style {
    public static final int AppTheme=0x7f050000;
}
}

Activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<TextView
    android:id="@+id/MainActivityTextview"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="@string/hello_world"
    tools:context=".MainActivity" />

</RelativeLayout>
  • 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-14T11:59:35+00:00Added an answer on June 14, 2026 at 11:59 am
    TextView textView = (TextView) findViewById(R.id.MainActivityTextview);
    

    Remove “android.”, it is your resource, not system.

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

Sidebar

Related Questions

I am getting stuck into the symfony practice tutorial and it is attempting to
Attempting a beginner's tutorial. I have the following in my head: <script type=text/javascript charset=utf-8
Attempting to build a C# NPAPI plugin I have found a tutorial which describes
When attempting to run the first example in the boost::mpi tutorial , I was
Attempting to make a NSObject called 'Person' that will hold the login details for
I am attempting to follow this tutorial (http://googleappsdeveloper.blogspot.co.uk/2011/12/using-new-js-library-to-unlock-power-of.html) to implement Google Calender using JavaScipt
Using NPOI and attempting to follow a tutorial here: http://www.zachhunter.com/2010/05/npoi-excel-template/ , I'm coming across
I am attempting to create a MapView application following the tutorial from the Android
Attempting to move an uploaded file so that it is saved in the directory,
I am attempting to configure ELMAH to filter 404 errors and I am running

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.