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

Related Questions

Tim Bray's article Saving Data Safely left me with open questions. Today, it's over
Good day I have question about displaying html documents in a windows forms applications.
I have a Client and Groupe Model. A Client can be part of multiple
I have just deployed my ASP.NET MVC 2 application using EF 4 and I
I have a ASP.NET MVC 2 project. I've created edmx file on the class
I am using the devart component dotconnect for postgresql. I have created the site
I'm mapping a set of attributes to my entity using @CollectionOfElements. The goal here
I am working on a site that multiple projects will be using to enter
I have an assembly generated using POCO template using Entity Framework (e.g. Company.Models.dll).Besides generated
In the Below action script file there is an error saying cannot import mx.controls.Label,

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.