I m getting a UnknownHostException when trying to post a photo to the user wall. Here is my code:
byte[] data = null;
Bitmap bi = BitmapFactory.decodeResource(getResources(), aDrawableId);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bi.compress(Bitmap.CompressFormat.JPEG, 70, baos);
data = baos.toByteArray();
Bundle parameters = new Bundle();
parameters.putByteArray("picture", data);
Log.i(getClass().toString(), parameters.toString());
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(this.facebook);
String method = String.format("me/photos?access_token=%s", this.facebook.getAccessToken());
mAsyncRunner.request(method, parameters, "POST", new FacebookRequestListener(), null);
我的汉斯·曼尼书上的许可:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
我的问题与前面的以下问题相同,我利用第二次回答(最高发言):
我在目录上获得的唯一信息是:
10-26 15:29:16.425: E/Facebook(5342): java.net.UnknownHostException: graph.facebook.com
你们对如何解决这一问题是否有任何想法? I m在银河S2号设备上运行。