android.content.res.Resources$NotFoundException: String resource ID #0x0
这是因为赋值给TextView的时候,应该赋予String,结果赋予了int....
- 04-11 14:26:58.584: E/AndroidRuntime(1247): android.content.res.Resources$NotFoundException: String resource ID #0x0
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at android.content.res.Resources.getText(Resources.java:201)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at android.widget.TextView.setText(TextView.java:2817)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at dc.sdk.weibo.activity.StatusesDetailActivity.bind(StatusesDetailActivity.java:221)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at dc.sdk.weibo.activity.StatusesDetailActivity.access$0(StatusesDetailActivity.java:213)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at dc.sdk.weibo.activity.StatusesDetailActivity$1.handleMessage(StatusesDetailActivity.java:236)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at android.os.Handler.dispatchMessage(Handler.java:99)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at android.os.Looper.loop(Looper.java:123)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at android.app.ActivityThread.main(ActivityThread.java:4627)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at java.lang.reflect.Method.invokeNative(Native Method)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at java.lang.reflect.Method.invoke(Method.java:521)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
- 04-11 14:26:58.584: E/AndroidRuntime(1247): at dalvik.system.NativeStart.main(Native Method)
resposts.setText(s.reposts_count+"");改成String就好了
comments.setText(s.comments_count+"");
------------------------------------------------
所谓的handler.post/handler.postDelayed这个不是子线程,是运行在UI线程内的,所以他可以更新UI
handler.post(new Runnable() {子线程是new Thread,子线程内不可以更新UI;
@Override
public void run() {
.... }
});
Runnable是一个接口。
------------------------------------------------------------
--
senRsl
2014-04-11 18:54
GMT+8 @Beijing Tongzhou
senRsl
2014-04-11 18:54
GMT+8 @Beijing Tongzhou
没有评论 :
发表评论