public void onComplete(final String response, final Object state) {
      try {
        // process the response here: executed in background thread
        Log.d("Facebook-Example", "Response: " + response.toString());
        JSONObject json = Util.parseJson(response);
        final String name = json.getString("name");

        // then post the processed result back to the UI thread
        // if we do not do this, an runtime exception will be generated
        // e.g. "CalledFromWrongThreadException: Only the original
        // thread that created a view hierarchy can touch its views."
        MainScreen.this.runOnUiThread(
            new Runnable() {
              public void run() {
                lblWelcome.setText("Welcome, " + name);
                Utility.strUsername = name;
                layoutForm.setVisibility(View.VISIBLE);
              }
            });
      } catch (JSONException e) {
        Log.w("Facebook-Example", "JSON Error in response");
      } catch (FacebookError e) {
        Log.w("Facebook-Example", "Facebook Error: " + e.getMessage());
      }
    }
 public void onComplete(final String response, final Object state) {
   Log.d("Facebook-FacebookInterfaceActivity", "Got response: " + response);
   String message = "<empty>";
   try {
     JSONObject json = Util.parseJson(response);
     message = json.getString("message");
   } catch (JSONException e) {
     Log.w("Facebook-FacebookInterfaceActivity", "JSON Error in response");
   } catch (FacebookError e) {
     Log.w("Facebook-FacebookInterfaceActivity", "Facebook Error: " + e.getMessage());
   }
   final String text = "Your Wall Post: " + message;
   FacebookInterfaceActivity.this.runOnUiThread(
       new Runnable() {
         public void run() {
           mText.setText(text);
         }
       });
 }
    public void onComplete(final String response, final Object state) {
      try {
        // process the response here: (executed in background thread)
        Log.d("Facebook-FacebookInterfaceActivity", "Response: " + response.toString());
        JSONObject json = Util.parseJson(response);
        final String src = json.getString("src");

        // then post the processed result back to the UI thread
        // if we do not do this, an runtime exception will be generated
        // e.g. "CalledFromWrongThreadException: Only the original
        // thread that created a view hierarchy can touch its views."
        FacebookInterfaceActivity.this.runOnUiThread(
            new Runnable() {
              public void run() {
                mText.setText("Hello there, photo has been uploaded at \n" + src);
              }
            });
      } catch (JSONException e) {
        Log.w("Facebook-FacebookInterfaceActivity", "JSON Error in response");
      } catch (FacebookError e) {
        Log.w("Facebook-FacebookInterfaceActivity", "Facebook Error: " + e.getMessage());
      }
    }
예제 #4
0
 public void onFacebookError(FacebookError e) {
   Log.d("FB", "facebook error");
   this.fba.error("Facebook error: " + e.getMessage(), callbackId);
 }
 public void onFacebookError(FacebookError e, final Object state) {
   Log.e("Facebook", e.getMessage());
   e.printStackTrace();
 }
예제 #6
0
 @Override
 public void onFacebookError(FacebookError e) {
   Log.e(Utilities.tag, e.getMessage());
 }
예제 #7
0
 @Override
 public void onFacebookError(FacebookError error) {
   GuiUtils.error(TAG, null, error, context);
   FacebookSessionEvents.onLoginError(error.getMessage());
 }
 @Override
 public void onFacebookError(FacebookError error) {
   Toast.makeText(
           getApplicationContext(), "Facebook Error: " + error.getMessage(), Toast.LENGTH_SHORT)
       .show();
 }
 public void onFacebookError(FacebookError error) {
   dialog.dismiss();
   Toast.makeText(
           getApplicationContext(), "Facebook Error: " + error.getMessage(), Toast.LENGTH_SHORT)
       .show();
 }
예제 #10
0
 @Override
 public void onFacebookError(FacebookError e, Object state) {
   // TODO Auto-generated method stub
   makeToast(e.getMessage());
 }