Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

How can I put a parameter into a localized string in Android?

// I use this in my string resource.

<string name="duration"><xliff:g id="minutes" example="42" >%s</xliff:g> mins <xliff:g id="seconds" example="28" >%s</xliff:g> secs</string>
// Which prints xx mins yy secs when you call:

getString(R.string.duration, minutes, seconds);
Comment

PREVIOUS NEXT
Code Example
Java :: array to map java3 
Java :: How to implement a Trie data structures in Java? 
Java :: concatenating two int in java 
Java :: java parse boolean to string 
Java :: random string generator java 
Java :: error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider; ^ 
Java :: how to disable screen rotation android studio 
Java :: Java android studio int to string 
Java :: how to parse double upto 2 decimal in java 
Java :: Exit program Android 
Java :: collision java 
Java :: como utilizar random en java 
Java :: maven spring-boot-configuration-processor install 
Java :: how to install java runtime environment on centos 7 
Java :: how to randomize an array java 
Java :: mostrar todos los elementos de un arraylist java 
Java :: java flatten list 
Java :: how to create java jframe in eclipse 
Java :: spring create bean only if another bean does not exists 
Java :: java font 
Java :: Integer i = new Integer(257); byte x = i.byteValue(); System.out.print(x); 
Java :: android java format date time 
Java :: java get domain from url 
Java :: play ringtone android in infinite loop 
Java :: xAxis.setTextSize() text gets clipped 
Java :: how to add animation to nivation component android 
Java :: how to navigate to last back stack in android studio 
Java :: how to add a keylistener to a jframe 
Java :: java stop executing my program 
Java :: java add listent to button 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =