ImageView ivCamera;
FlashLightControl = (Button)findViewById(R.id.flashcontrol);
ivCamera = (ImageView)findViewById(R.id.iv_camera);
Syntax error on token ";" ,, expected.
- Multiple markers at this line
- Syntax error on token ")", { expected after this token
- Syntax error, insert ";" to complete FieldDeclaration
- Syntax error on token ".", ... expected
- Return type for the method is missing
Syntax error, insert "}" to complete MethodBody
答案 0 :(得分:0)
您需要为FlashLightControl变量命名:
FlashLightControl flc = (Button)findViewById(R.id.flashcontrol);
ivCamera = (ImageView)findViewById(R.id.iv_camera);
另一方面,Button
可以被视为FlashLightControl
个实例吗?
也许你想要
Button flashLightControl = (Button)findViewById(R.id.flashcontrol);
答案 1 :(得分:0)
您似乎缺少对象引用。请更改以下代码行:
FlashLightControl = (Button)findViewById(R.id.flashcontrol);
对此:
FlashLightControl flashControlName = (Button)findViewById(R.id.flashcontrol);
但是,只有当FlashLightControl
属于Button
类型或与其兼容时才会有效。
希望这有帮助。