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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:51:39+00:00 2026-05-24T16:51:39+00:00

I am new to Android development. In the Notepad sample, I saw the following

  • 0

I am new to Android development. In the Notepad sample, I saw the following code snippet:

SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.noteslist_item, cursor,
        new String[] { Notes.TITLE }, new int[] { android.R.id.text1 });

and in the notelist_item.xml file:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"   <-----------HERE
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:gravity="center_vertical"
    android:paddingLeft="5dip"
    android:singleLine="true"
/>

So, I am wondering, what is this android.R.id.text1?

Also, I found android.R.id.button1, button2, button3 in the android.jar file.

Are they some kind of well known IDs for some 3rd party controls?

Thanks

  • 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-24T16:51:40+00:00Added an answer on May 24, 2026 at 4:51 pm

    android.R.id.text1 is just an identifier defined in the Android framework.

    In the framework, android.R.id.text1 is an used for TextView views. You can find it in many layouts from the framework (select_dialog_item, select_dialog_singlechoice, simple_dropdown_item_1line, etc.). In Android framework xml, it is represented by @+id/text1.

    Hence, if you use one of these layouts and want to change the text, you will need to use this id.

    // probably in a custom ListAdapter that uses 
    View view = inflater.inflate(android.R.layout.simple_list_item_1, parent, false);
    TextView textView = (textView) view.findViewById(android.R.id.text1);
    textView.setText("Oh no! not hello world again");
    

    Also, you can use this same identifier to identify a TextView (or anything) in your custom layouts. See in the sample "Notepad", the layout file noteslist_item.xml.

    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:gravity="center_vertical"
    android:paddingLeft="5dip"
    android:singleLine="true"  
    />
    

    And actually, you could use R.id.text1 as an identifier of anything else, but that would be confusing.

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

Sidebar

Related Questions

I am new to Android development. I am trying to use the following code
im new to android development so please forgive me if this is an easy
Hi I am new into android development and I am having trouble into this
I a new to Android development, so this is kind of a basic question.
I am New to Android Development.How to convert the Following string(5/31/2011) in to the
I'm very new to Android development and can't find the answer to this. I
I am very new to Android development, so I appologise in advance if this
I'm new to android development and needs help here.I want to create a layout
I am new to Android development and want to build a first sample application.
I am new to android development and my code is not working how it

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.