android - How to include a string resource in XML format accessible in every *.cs file? -


As my title says, how can I include a resource string in XML format that I can access with my ID Can i It is auto generated in id dot2 but I do not get any education in Google.

Create a new file string with this content. XMM:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Resources & gt; & Lt; String name = "first name" & gt; Mr. Fifth & lt; / String & gt; & Lt; / Resources & gt;   

Add this to your project and set the build action property to 'Values ​​Resource'.

If you open RCS (inside the Properties folder), you will see that the following code is generated:

  // --------- --------------------------------------------------- ------------------- // This file is automatically generated by dot42 --------------------- ---------------------- ---------------------------- ------- Namespace dot42Application2 {By using the system; Public sealed class r {public sealed class strings {public const int firstName = 0x7f040000; }}}   

You can access your string processing in #c like this:

  string firstname = GetString (R. Strings.firstName );    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -