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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:25:12+00:00 2026-06-01T15:25:12+00:00

I’ve declare a String : <string name=Please>Please Select</string> in the res/values/Strings.xml . Now I

  • 0

I’ve declare a String:

<string name="Please">Please Select</string>

in the res/values/Strings.xml. Now I want to access this String value but what I can get can go till id not value like:

 int i = findViewById(R.string.Please);

But what I want is just the value of the string Please.

Thanks for all of your answer but my problem is a little bigger

What I wanted to do is just to display date with app_name

from all your answers i can get the app_name String
but whether I can set
This app_name with current date

<string name="app_name">My app</string>

and also I’m to set my in this way

My app(in Left alignment)             Date (in right aligment)

and also on start of first activity i want to set app_name and not on every activity;

I think it may work let me try

setResource().setString(R.string.Please);

but no setResource() method sorry.

  • 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-01T15:25:13+00:00Added an answer on June 1, 2026 at 3:25 pm

    You cant set a string, its static, and cant be changed at run-time, what you want to do is something like this

            Calendar cal = Calendar.getInstance();
            String date = cal.get(Calendar.DAY_OF_MONTH) + "/" + cal.get(Calendar.MONTH) + "/" + cal.get(Calendar.YEAR);
            setTitle(date);
    

    Your trying to set the title as the date right?

    To have two titles it is a bit harder, first you need a layout, call this custom_title_1

    This is the xml code for that layout

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/screen"
        android:layout_width="match_parent" android:layout_height="match_parent"
        android:orientation="vertical">
        <TextView android:id="@+id/left_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:text="@string/custom_title_left" />
        <TextView android:id="@+id/right_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:text="@string/custom_title_right" />
    </RelativeLayout>
    

    Then in your code before you call the UI you need to call this:

    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    

    then set you content view

    then call this which will set the title:

    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title_1);
    

    Now you can find the two textViews and set the text:

    TextView leftText = (TextView) findViewById(R.id.left_text);
    TextView rightText = (TextView) findViewById(R.id.right_text);
    
    Calendar cal = Calendar.getInstance();
    String date = cal.get(Calendar.DAY_OF_MONTH) + "/" + cal.get(Calendar.MONTH) + "/" + cal.get(Calendar.YEAR);
    String app_name = getString(R.string.app_name);
    leftText.setText(app_name);
    rightText.setText(date);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace

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.