我无法上传从SD卡在Facebook上的图像...我用下面的代码....但它没有给我错误,但在同一时间它没有上传图片从android SD卡上传图片到facebook
byte[] data = null;
try {
FileInputStream fis = new FileInputStream(filepath);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 2;
Bitmap bi = BitmapFactory.decodeStream(fis);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
data = baos.toByteArray();
} catch (FileNotFoundException e) {
e.printStackTrace();
Log.d("onCreate", "debug error e = " + e.toString());
}
Bundle params = new Bundle();
params.putString("method", "photos.upload");
params.putByteArray("picture", data);
我增加了这段代码,但在facebook对话框中显示“发生错误”,请稍后重试。 –
它在logcat中显示的内容?贴吧在这里 –
{“错误”:{“消息”:“一个积极的访问令牌必须用于查询当前用户的信息。”,“类型”:“OAuthException”,“代码”:2500}} –