编辑============
从 MANIFEST.MF 文件粘贴:
Main-Class: winterwell.jtwitter.Twitter
Implementation-Version: 2.9.0
Implementation-Title: JTwitter client library by Winterwell
Android Studio 0.2.9
jtwitter 2.9.0
你好,
我一直在关注有关创建 yamba 客户端的 marakana 视频。
但是,我注意到 getPublicTimeline api 调用现在已从 jtwitter 中删除,因为 twitter 不再支持这一点。所以我已经厌倦了使用替代方法,但得到了一个我在下面剪切并粘贴的错误。
我尝试过的不同 API 是getFriendsTimeline
, getHomeTimeline
。
我正在使用的代码片段:
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.status);
edit_status = (EditText)findViewById(R.id.editText);
tw = new Twitter("student", "password");
tw.setAPIRootUrl("http://yamba.marakana.com/api");
}
public class GetHomeStatus extends AsyncTask<String, Integer, String>
{
@Override
protected String doInBackground(String... statues)
{
int i = 0;
List<winterwell.jtwitter.Status> timeline;
try {
timeline = twitter.getFriendsTimeline();
//twitter.setStatus("Hello, there!");
}
catch (TwitterException e) {
e.printStackTrace();
return "Failed to get timeline";
}
我认为后台线程没有问题,因为twitter.setStatus("Hello, there!");
工作正常。
许多建议将不胜感激
例外:
275-445/system_process W/InputMethodManagerService﹕ Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4193edb0 attribute=null, token = android.os.BinderProxy@4177e720
09-11 03:58:37.108 3187-3204/com.sunsystems.yambaapp W/System.err﹕ winterwell.jtwitter.TwitterException: 301 Moved Permanently
09-11 03:58:37.108 3187-3204/com.sunsystems.yambaapp W/System.err﹕ HTTP/1.1 301 Moved Permanently https://marakana.com/s/tags/breaking_open/?include_entities=1& -> https://marakana.com/s/tags/breaking_open/?include_entities=1&
09-11 03:58:37.118 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at winterwell.jtwitter.URLConnectionHttpClient.processError(URLConnectionHttpClient.java:513)
09-11 03:58:37.118 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at winterwell.jtwitter.URLConnectionHttpClient.connect(URLConnectionHttpClient.java:155)
09-11 03:58:37.118 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at winterwell.jtwitter.URLConnectionHttpClient.getPage2(URLConnectionHttpClient.java:311)
09-11 03:58:37.118 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at winterwell.jtwitter.URLConnectionHttpClient.getPage(URLConnectionHttpClient.java:251)
09-11 03:58:37.118 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at winterwell.jtwitter.Twitter.getStatuses(Twitter.java:1660)
09-11 03:58:37.118 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at winterwell.jtwitter.Twitter.getHomeTimeline(Twitter.java:1162)
09-11 03:58:37.118 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at winterwell.jtwitter.Twitter.getFriendsTimeline(Twitter.java:1153)
09-11 03:58:37.118 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at com.sunsystems.yambaapp.UpdateService$GetHomeStatus.doInBackground(UpdateService.java:70)
09-11 03:58:37.118 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at com.sunsystems.yambaapp.UpdateService$GetHomeStatus.doInBackground(UpdateService.java:61)
09-11 03:58:37.128 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:287)
09-11 03:58:37.128 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:234)
09-11 03:58:37.128 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
09-11 03:58:37.128 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
09-11 03:58:37.128 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
09-11 03:58:37.128 3187-3204/com.sunsystems.yambaapp W/System.err﹕ at java.lang.Thread.run(Thread.java:841)