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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:59:15+00:00 2026-06-16T00:59:15+00:00

How can I create a layout file with data and fill them with some

  • 0

How can I create a layout file with data and fill them with some example data so that I can see what I have done without producing warnings.

Here is an example:

Simple android UI

If I remove the text (which wants Android Lint) I have a plain blue screen, which is not helpful at all.

By the way this is the warning:

[I18N] Hardcoded string “Foobar”, should use @string resource example.xml /Example/res/layout Line 42 Android Lint Problem

  • 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-16T00:59:16+00:00Added an answer on June 16, 2026 at 12:59 am

    Create an entry in your strings.xml for each of your example Strings.

    On the other hand, this is a Lint warning. You can safely ignore this without causing immediate harm to your app, as these are only meant to guide you in best practices.

    enter image description here

    Go to the Eclipse preferences, into the Android submenu, then into the Lint Error Checking menu and disable the HardcodedText warning.

    Second Method

    Instead of setting the example text through XML, use the setText() through Java code, and enclose it in an if condition as follows:

    if(BuildConfig.DEBUG) {
        view.setText("My example text");
    }
    

    BuildConfig.DEBUG was added in ADT 17, and is true whenever you do a debug build. When you export the apk, it is set to false. As the variable is set to false and never reassigned, the Java compiler will optimize your code and remove these statements. They will not be compiled into a production app.

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

Sidebar

Related Questions

I have a .net file that utilizes a c# to process some form(post) information,
I can create a contact that is not mail enabled, but how do I
One can create an anonymous object that is initialized through constructor parameters, such as
i have a model that returns car data with id, name, price etc. So
I'm trying to build a small app that takes a data file in external
I have content to be installed, but it's file and folder layout is determined
I'd like to build a simple form that I can use to create a
If we already have a database file in .sql format, how can we load
How can a have a ListView that has different amount of rows? Instead of
so i have an already working jquery ajax application that i'm trying to create

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.