.....
imageview_fbshare.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(Util.isDeviceOnline(MainActivity.this)) {
Util.showProDialog(MainActivity.this,"Please wait....");
LoginManager.getInstance().logInWithPublishPermissions(
MainActivity.this,
Arrays.asList("publish_actions"));
ByteArrayOutputStream stream = new ByteArrayOutputStream();
lastimage.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
Bundle params = new Bundle();
// params.putString("caption", etxt_status.getText().toString());
//params.putString("place", user_loc_id);
//params.putString("tags", ids);
params.putByteArray("picture", byteArray);
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/" + user_id + "/photos",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
//new getPlaceId().execute();
JSONObject o = response.getJSONObject();
try {
String user_status_id = o.getString("id");
} catch (Exception ex) {
}
Util.dimissProDialog();
}
}
).executeAsync();
}
else {
Toast.makeText(MainActivity.this,"OOps! Network Connection Error",Toast.LENGTH_LONG).show();
}
}
});
imageview_fbshareを解決できないライン。私はこの仕事をすることができません –
Facebookのイメージを共有しているクリックの簡単なイメージビューです。ボタンのonclickの中に入れてください。 –
Util.isDeviceOnlineはFacebook APIの一部ですか?カントはそれを解決するようです。 –