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

  • Home
  • SEARCH
  • 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 581299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:33:50+00:00 2026-05-13T14:33:50+00:00

I specified a meta-data in my manifest.xml like this: <meta-data android:value="5555555555" android:name="foo"></meta-data> When accessing

  • 0

I specified a meta-data in my manifest.xml like this:

<meta-data android:value="5555555555" android:name="foo"></meta-data>

When accessing the metadata like this:

ActivityInfo ai = act.getPackageManager().getActivityInfo(componentName, PackageManager.GET_META_DATA);
Object value = (Object)ai.metaData.get(key);

this value gets interpreted as int and – more importantly – incorrectly interpreted (1260588259).

Since the type is determined automatically by the build system ( booleans, ints, floats, and strings ) I wondered if there is any way to force the data type to string.

I tried adding a space at the end ( "5555555555 "), but then the value gets interpreted as 5.5555553E9 float! ).

I also tried using getString instead of get, but then null is returned.

Any ideas? TIA.

  • 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-13T14:33:50+00:00Added an answer on May 13, 2026 at 2:33 pm

    Putting an escaped space in front of the number seems to work:

    <meta-data android:name="foo" android:value="\ 1234567890"/>
    

    The escaped space doesn’t appear in the value returned by get().

    I have no idea quite how this works, if I’m honest.

    If you want something documented and therefore more reliable you can always put your string value as a resource and refer to it:

    <meta-data android:name="foo" android:resource="@string/mynumber"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 338k
  • Answers 338k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Navigate method is asynchronous, so you should wait for NavigationComplete… May 14, 2026 at 4:14 am
  • Editorial Team
    Editorial Team added an answer Some companies organize the path of the namespace according to… May 14, 2026 at 4:14 am
  • Editorial Team
    Editorial Team added an answer If this does what you want to do, then it's… May 14, 2026 at 4:14 am

Related Questions

I'm using the built-in Java XML Transformer to serialize an XML document into text.
Problem overview: When using Eclipse Ganymede with the Web Tools Platform the project gets
This question has been retitled/retagged so that others may more easily find the solution
I have status tables in my database, and localised tables that contain language-specific versions
I have a WCF service hosted in IIS7 with netTCP enabled. This is my

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.