如何识别其中code是不正确的,如果我得到警告转换​​为字符串:的TypedValue? [英] How to identify where code is incorrect, if I get warning Converting to string: TypedValue?

查看:298
本文介绍了如何识别其中code是不正确的,如果我得到警告转换​​为字符串:的TypedValue?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是摘录LogCat中:

  04-04 19:51:51.270:信息/ ActivityManager(57):启动活动:意向{CMP = com.example.app /.preferences}
04-04 19:51:51.710:WARN /资源(1081):转换为字符串:{的TypedValue T = 0×10 / D =为0x0 A = -1}
04-04 19:51:51.740:WARN /资源(1081):转换为字符串:{的TypedValue T = 0×10 / D =为0x0 A = -1}
04-04 19:51:51.761:WARN /资源(1081):转换为字符串:{的TypedValue T = 0×10 / D = 0x79e一个= -1}
04-04 19:51:51.800:WARN /资源(1081):转换为字符串:{的TypedValue T = 0×10 / D = 0x5a0一个= -1}
04-04 19:51:51.810:WARN /资源(1081):转换为字符串:{的TypedValue T = 0×10 / D = 0x5的一个= -1}
04-04 19:51:51.830:WARN /资源(1081):转换为字符串:{的TypedValue T = 0×10 / D =一个是0xA = -1}
04-04 19:51:51.840:WARN /资源(1081):转换为字符串:{的TypedValue T = 0×10 / D =一个是0xA = -1}
04-04 19:51:51.860:WARN /资源(1081):转换为字符串:{的TypedValue T = 0×10 / D = 0X1E一个= -1}
04-04 19:51:51.870:WARN /资源(1081):转换为字符串:{的TypedValue T = 0×10 / D = 0X1E一个= -1}
04-04 19:51:53.450:信息/ ActivityManager(57):显示活动com.example.app /.preferences:2061毫秒(共2061毫秒)
 

解决方案

的<一个href="http://developer.android.com/reference/android/util/TypedValue.html"><$c$c>TypedValue从logcat的获得可除preTED是这样的:

  • T ==>型( 0×10 = TYPE_INT_DEC
  • D ==>的实际数据(具体由 T
  • A ==>其他有关信息 其中值来自;只设置 为字符串。
  • 研究 ==>最终的资源ID(未设定 如果你通过文字值)

所以我猜你必须寻找整数,你把它预期的字符串。

Here is the extract from LogCat:

04-04 19:51:51.270: INFO/ActivityManager(57): Starting activity: Intent { cmp=com.example.app/.Preferences }
04-04 19:51:51.710: WARN/Resources(1081): Converting to string: TypedValue{t=0x10/d=0x0 a=-1}
04-04 19:51:51.740: WARN/Resources(1081): Converting to string: TypedValue{t=0x10/d=0x0 a=-1}
04-04 19:51:51.761: WARN/Resources(1081): Converting to string: TypedValue{t=0x10/d=0x79e a=-1}
04-04 19:51:51.800: WARN/Resources(1081): Converting to string: TypedValue{t=0x10/d=0x5a0 a=-1}
04-04 19:51:51.810: WARN/Resources(1081): Converting to string: TypedValue{t=0x10/d=0x5 a=-1}
04-04 19:51:51.830: WARN/Resources(1081): Converting to string: TypedValue{t=0x10/d=0xa a=-1}
04-04 19:51:51.840: WARN/Resources(1081): Converting to string: TypedValue{t=0x10/d=0xa a=-1}
04-04 19:51:51.860: WARN/Resources(1081): Converting to string: TypedValue{t=0x10/d=0x1e a=-1}
04-04 19:51:51.870: WARN/Resources(1081): Converting to string: TypedValue{t=0x10/d=0x1e a=-1}
04-04 19:51:53.450: INFO/ActivityManager(57): Displayed activity com.example.app/.Preferences: 2061 ms (total 2061 ms)

解决方案

The TypedValue you get from logcat can be interpreted this way:

  • t ==> type (0x10 = TYPE_INT_DEC)
  • d ==> the actual data (to be intepreted as specified by t)
  • a ==> Additional information about where the value came from; only set for strings.
  • r ==> eventual resource id (not set if you passed a literal value)

So I guess you have to look for integers that you put where it expected strings.

这篇关于如何识别其中code是不正确的,如果我得到警告转换​​为字符串:的TypedValue?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆