-1
@Override
public void onActivityResult((int requestCode,int resultCode,Intent data))
{
    super.onActivityResult(requestCode, resultCode, data);
    fb.authorizeCallback(requestCode, resultCode, data);
}

I actually took the above code from net and placed but am getting error like this:

Multiple markers at this line:

  • Syntax error on token ",", ; expected
  • Syntax error on token ",", ; expected
  • Syntax error on token(s), misplaced construct(s)
  • void is an invalid type for the variable onActivityResult
  • Syntax error, insert ";" to complete LocalVariableDeclarationStatement
  • Syntax error, insert ";" to complete LocalVariableDeclarationStatement
4

4 回答 4

1

去掉多余的括号:

public void onActivityResult((int requestCode,int resultCode,Intent data))

试试这个:

public void onActivityResult(int requestCode, int resultCode, Intent data)
于 2012-07-03T16:55:26.203 回答
1

您的方法签名中有一组额外的括号。尝试使用:

@Override
protected void onActivityResult(int requestCode,int resultCode,Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);
    fb.authorizeCallback(requestCode, resultCode, data);
}
于 2012-07-03T16:55:41.693 回答
1

这一行:

public void onActivityResult((int requestCode,int resultCode,Intent data))

应该:

public void onActivityResult(int requestCode,int resultCode,Intent data)

请注意删除了方法参数周围的第二组括号。

于 2012-07-03T16:56:12.490 回答
1

参数说明的括号是多余的。尝试:

@Override
public void onActivityResult(int requestCode,int resultCode,Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);
    fb.authorizeCallback(requestCode, resultCode, data);
}

编辑

如果仍然遇到语法错误,粘贴整个 Activity 类的源代码会很有帮助。

于 2012-07-03T16:56:42.560 回答