JavaEar 专注于收集分享传播有价值的技术资料

Multiple markers at this line - Syntax error on token ",", ; expected

@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个回答

    最佳答案
  1. Remove the extra parenthesis:

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

    And try this:

    public void onActivityResult(int requestCode, int resultCode, Intent data)
    
  2. 参考答案2
  3. You have an extra set of brackets in your method signature. Try using:

    @Override
    protected void onActivityResult(int requestCode,int resultCode,Intent data)
    {
        super.onActivityResult(requestCode, resultCode, data);
        fb.authorizeCallback(requestCode, resultCode, data);
    }
    
  4. 参考答案3
  5. This line:

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

    Should be:

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

    Note the removal of the second set of parenthesis around the arguments to the method.

  6. 参考答案4
  7. The parentheses of the parameter specification are redundant. Try:

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

    Edit

    If you still get syntax errors, it would be helpful to paste the source code of the whole Activity class.