实际上我在这方面还很新,所以这个问题对你们中的许多人来说可能有点愚蠢。无论如何,这里是:
我正在android上创建这个应用程序,它应该从edittext字段中获取输入并将其发布到facebook页面墙上。
现在我有这个代码,但它hows mfacebook.**dialog**(this, "stream.publish", params, this);
有一个错误说:The method dialog(Context, String, Bundle, Facebook.DialogListener) in the type Facebook is not applicable for the arguments (new View.OnClickListener(){}, String, Bundle, new View.OnClickListener(){})
。
有人可以告诉我有什么问题吗?
public class FetchData extends Activity {
private Facebook mfacebook;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fetch_data);
final Button widget45 = (Button)findViewById(R.id.widget45);
final Button widget44 = (Button)findViewById(R.id.widget44);
final Button imageButton2 = (Button)findViewById(R.id.imageButton2);
final Button imageButton1 = (Button)findViewById(R.id.imageButton1);
final ImageButton widget48 = (ImageButton)findViewById(R.id.widget48);
final ImageButton widget49 = (ImageButton)findViewById(R.id.widget49);
final ImageButton widget51 = (ImageButton)findViewById(R.id.widget51);
final ImageButton widget56 = (ImageButton)findViewById(R.id.widget56);
final EditText widget40 = (EditText)findViewById(R.id.widget40);
.
.
.
.
.
.
.
.
imageButton1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//To change body of implemented methods use File | Settings | File Templates.
mfacebook = new Facebook("558718227474980");
Bundle params = new Bundle();
params.putString("message", widget40.getText().toString());
mfacebook.dialog(this, "stream.publish", params, this);
}
});
}
}