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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:58:29+00:00 2026-06-17T19:58:29+00:00

I need to display a string in a TextView that begins with the @

  • 0

I need to display a string in a TextView that begins with the @ sign for a Twitter handle. When I put the string in my strings.xml, it doesn’t like the @ at the beginning of the string and gives the error:

error: Error: No resource type specified (at 'twitter_handle' with value '@twitter_handle').

The layout.xml that has the TextView in it that uses the string resource gives the error:

The following classes could not be found:
- TextView (Change to android.widget.TextView, Fix Build Path, Edit XML)

There is no error if the @ sign is not at the beginning of the text, but anywhere else in the string.

If I escape the @ sign with either &#64 or \u0040, the error goes away in the strings.xml, but I still get the error in the layout.xml.

Is there any way to use a string that begins with the @ sign in a TextView in a layout.xml?

strings.xml:

...
<string name="twitter_handle">@twitter_handle</string>
...

layout.xml:

...
<TextView
    ...
    android:text="@string/twitter_handle"
    ... />
...

Undoubtedly the problem has to do with the fact that a leading @ implies a reference to a resource, but shouldn’t escaped @ signs be taken into account and work correctly?

Update: This issue was found to be a bug in the ADT Eclipse plugin. Installing the latest version recently released fixes the issue and escaping the @ in the strings.xml no longer causes an error.

  • 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-17T19:58:30+00:00Added an answer on June 17, 2026 at 7:58 pm

    Escape it with a leading slash, like this: <string name="test">\@twitter</string>

    Edit: I should have read. You can programmatically assign the String to the TextView, by getting a string from it and set it to the TextView

     String twitter = getString(R.id.twitter);
     textView.setText(twitter);
    

    Edit 2: Try this instead of the @ sign: &#64;. It’s the html code for the sign.

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

Sidebar

Related Questions

I need to create a String placed in a TextView that will display a
I need to concatenate two string and display with single text view. That string
I need to display short description like label and near it data associated with
I need to display a multiply sign (×) in a modal being created by
I need to display the parent from the first Element of input.xml Also I
I need to Display the songtitle2.get(i).charAt(0) in the textview. I have already populated the
I am making an application for Android and I need to display an XML
Hey i have a textview i need to count the string length of textview
In my project I need to display a paragraph and questions(with options) on that
I am reading a string from an xml file stored on the sdcard that

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.