English 中文(简体)
java.net. Un knownHostException: graph.facebook.com
原标题:java.net.UnknownHostException: graph.facebook.com

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" />

我的问题与前面的以下问题相同,我利用第二次回答(最高发言):

甲型六氯环己烷和甲状腺 f壁的电文总是错误

我在目录上获得的唯一信息是:

10-26 15:29:16.425: E/Facebook(5342): java.net.UnknownHostException: graph.facebook.com

你们对如何解决这一问题是否有任何想法? I m在银河S2号设备上运行。

问题回答




相关问题
handling exceptions IN Action Filters

Is there a better way to handle exceptions that occur inside an Action Filter itself in ASP .NET MVC? There re 2 ways I can think of at the moment. Using a try catch and setting the HTTP Status ...

既可捕获,又可举出例外。

我有一种办法,可以进入亚洲开发银行,因此,我国的亚行在多瑙河航道中的所有 st子都位于一个试捕区。 它正在追捕Kexception

Cross compiler exception handling - Can it be done safely?

I am doing some maintenance on a C++ windows dll library that is required to work with different VC++ compilers (as I don’t want to address different mangling schemes). I have already eliminated any ...

File Handling Issue

I am developing a tool in c#, at one instance I start writing into a xml file continuously using my tool,when i suddenly restart my machine the particular xml file gets corrupted, what is the reason ...

Watch a memory location/install data breakpoint from code?

We have a memory overwrite problem. At some point, during the course of our program, a memory location is being overwritten and causing our program to crash. the problem happens only in release mode. ...

Unit Test for Exceptions Message

Is there a simple (Attribute-driven) way to have the following test fail on the message of the exception. [TestMethod()] [ExpectedException(typeof(ArgumentException))] public void ExceptionTestTest() ...

热门标签