diff between Context.getResources().getString() and Context.getString()
2011-03-08 17:54
633 查看
in the refrences ,I did't know what's its mean.
Context.getResources().getString() Return the string value associated with a particular resource ID. It will be stripped of any styled text information.
Context.getString() Return a localized string from the application's package's default string table.
so i got the sources ,found that they are totally the same.
/android_opensource/frameworks/base/core/java/android/content/Context.java
...
141 /**
142 * Return a localized string from the application's package's
143 * default string table.
144 *
145 * @param resId Resource id for the string
146 */
147 public final String getString(int resId) {
148 return getResources().getString(resId);
149 }
...
read the sources more
from:http://hi.baidu.com/ksoftware/blog/item/2b7b0ad131320a329b5027a7.html
Context.getResources().getString() Return the string value associated with a particular resource ID. It will be stripped of any styled text information.
Context.getString() Return a localized string from the application's package's default string table.
so i got the sources ,found that they are totally the same.
/android_opensource/frameworks/base/core/java/android/content/Context.java
...
141 /**
142 * Return a localized string from the application's package's
143 * default string table.
144 *
145 * @param resId Resource id for the string
146 */
147 public final String getString(int resId) {
148 return getResources().getString(resId);
149 }
...
read the sources more
from:http://hi.baidu.com/ksoftware/blog/item/2b7b0ad131320a329b5027a7.html
相关文章推荐
- String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServe
- The difference between GetDC and GetWindowDC
- Android——Context.getString()
- How to get URL and QueryString value in an ASP.NET page
- trim content between begin and end lines or get from keyword line to file end
- javax.servlet.jsp.JspException: Error - tag.getAsString : component context is not defined. Check tag syntax
- Conversion Between BitString and String
- What is the Difference Between `apt-get purge` and `apt-get remove`?
- The diff between throw and throw e
- String path = request.getContextPath(....拼装当前网页的相对路径
- Difference between getContext() , getApplicationContext() , getBaseContext()
- NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String
- 在tomcat 8中使用String upload = this.getServletContext().getRealPath("upload")为null
- Which should we choice between javax.faces.bean.XScoped and javax.enterprise.context.XScoped
- NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String
- What is the difference between SVD and matrix factorization in context of recommendation engine?
- Part 59 to 60 Difference between Convert ToString and ToString,String and StringBuilder
- 转发重定向用到的绝对路径 String path = request.getContextPath
- What is different between ClassLoader.getResourceAsStream() and Class.getResourceAsStream()?
- String path = request.getContextPath(....拼装当前网页的相对路径