我想从我的应用程序中添加朋友,我有一个想法,可以获取URL按钮来添加(从“个人资料”中)并在不打开网络的情况下创建URL 这是我的代码:
public void Add() {
final AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams();
params.put("key", "value");
params.put("more", "data");
client.get("https://m.facebook.com/a/mobile/friends/profile_add_friend.php?subjectid=100030701077313&istimeline=1&hf=profile_button&fref=unknown&frefid=0&gfid=AQCcjGgPKoUEnGP1", params, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
Toast.makeText(MainActivity.this, "add", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
}
});
}
我正在向Toast展示,但不添加朋友,请帮助...