【发布时间】:2012-06-08 19:06:31
【问题描述】:
我正在使用 twitpic 库在 twitter 上发布图像,但我得到 - 无效的 twitpic 用户名和密码错误。 这个有什么解决办法吗?? witpic的用户名和密码是什么?我只是用我的 Twitter ID 和密码来代替它。
这是我的代码
// Create file
File picture = new File(Environment.getExternalStorageDirectory()+"/image.jpg");
if(picture.exists())
{
System.out.println("Picture accesseds");
}
// Create TwitPic object and allocate TwitPicResponse object
TwitPic tpRequest = new TwitPic("gauravarora90", "gaurav");
TwitPicResponse tpResponse = null;
// Make request and handle exceptions
try {
tpResponse = tpRequest.uploadAndPost(picture, "Hello World!!!");
} catch (IOException e) {
e.printStackTrace();
} catch (TwitPicException e) {
e.printStackTrace();
}
// If we got a response back, print out response variables
if(tpResponse != null) {
tpResponse.dumpVars();
System.out.println(tpResponse.getStatus());
if(tpResponse.getStatus().equals("ok")){
Toast.makeText(getApplicationContext(), "Photo posted on Twitter.",Toast.LENGTH_SHORT).show();
//picture.delete();
}
}
请帮助我。提前致谢。
【问题讨论】: