我对 Android 开发有点陌生,在尝试创建启动另一个名为 areacircle 的活动的 Intent 时收到此错误:
Syntax error on token "(",; expected
Syntax error on token ")",; expected
void is an invalid type for the variable acircle
编辑:我添加了整个代码块
我希望这段代码可以帮助你帮助我:
public class findmy extends Activity {
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.findmy);
public void acircle(View view) {
Intent acircleIntent = new Intent(this, areacircle.class);
startActivity(acircleIntent);
}
}
}