-2
當調試程序獲取推文時,但是當我只運行時說「不幸的是,APP已經停止。」在Fabric中使用Twitter API
private void CargarTweets() {
setProgressBarIndeterminateVisibility(true);
myLayout.removeAllViews();
StatusesService statusesService = Twitter.getApiClient().getStatusesService();
statusesService.userTimeline(null,"wgcv",10,null,null,null,null,null,null, new Callback<List<Tweet>>() {
@Override
public void success(Result<List<Tweet>> listResult) {
setProgressBarIndeterminateVisibility(false);
for (Tweet tweet : listResult.data) {
myLayout.addView(
new CompactTweetView(Principal.this, tweet));
}
}
@Override
public void failure(TwitterException e) {
}
});
的logcat:
03-13 13:49:09.937 3093-3093/me.wgcv.emergenciasgye E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: me.wgcv.emergenciasgye, PID: 3093
java.lang.IllegalArgumentException: MetricsManager may not be null
at com.twitter.sdk.android.tweetui.internal.TweetViewMetric.<init>(TweetViewMetric.java:30)
at com.twitter.sdk.android.tweetui.BaseTweetView.getTweetViewMetric(BaseTweetView.java:355)
at com.twitter.sdk.android.tweetui.BaseTweetView.initComponents(BaseTweetView.java:347)
at com.twitter.sdk.android.tweetui.BaseTweetView.<init>(BaseTweetView.java:135)
at com.twitter.sdk.android.tweetui.BaseTweetView.<init>(BaseTweetView.java:115)
at com.twitter.sdk.android.tweetui.BaseTweetView.<init>(BaseTweetView.java:105)
at com.twitter.sdk.android.tweetui.CompactTweetView.<init>(CompactTweetView.java:19)
at me.wgcv.emergenciasgye.Principal$1.success(Principal.java:66)
at com.twitter.sdk.android.core.Callback.success(Callback.java:23)
at retrofit.CallbackRunnable$1.run(CallbackRunnable.java:45)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
???請提供更多信息... – JoJo 2015-03-13 18:29:02
當我調試程序運行正常,但是當我運行程序崩潰。我認爲是請求的響應時間 – wgcv 2015-03-13 18:32:36
03-13 13:45:08.377 3013-3013/me.wgcv.emergenciasgye E/AndroidRuntime:致命例外:main 進程:me.wgcv.emergenciasgye,PID:3013 java.lang .IllegalArgumentException:在com.twitter.sdk.android.tweetui.internal.TweetViewMetric中,MetricsManager可能不爲null 。(TweetViewMetric.java:30) –
wgcv
2015-03-13 18:47:34