Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
令牌上的语法错误Android开发错误_Android - Fatal编程技术网

令牌上的语法错误Android开发错误

令牌上的语法错误Android开发错误,android,Android,我对Android开发有点陌生,当我试图创建一个意图来启动另一个名为areacircle的活动时,我收到了这个错误: Syntax error on token "(",; expected Syntax error on token ")",; expected void is an invalid type for the variable acircle 编辑:我添加了整个代码块 我希望此代码可以帮助您帮助我: public class findmy extends Activ

我对Android开发有点陌生,当我试图创建一个意图来启动另一个名为areacircle的活动时,我收到了这个错误:

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);
                }
            }
}改变

public void acircle(View view) {
Intent acircleIntent = new Intent(this, areacircle.class);
startActivity(acircleIntent);
        };
    }
致:

移除;从}之后的第四行开始,您的问题应该消失了

public void acircle(View view) {
Intent acircleIntent = new Intent(this, areacircle.class);
startActivity(acircleIntent);
        }
    }

如果您在单击按钮时正在启动另一个活动,请尝试这样做

public class findmy extends Activity {
 @Override
 public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.findmy);
    Button d = (Button) findViewById(R.id.btnTitle3);
    d.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent acircleIntent = new Intent(this, areacircle.class);
            startActivity(acircleIntent);
        }
    });

 }
}

先学习java语法。。。这不是一个运行时错误…我可以对这段代码进行任何修复吗?是的,检查所有的括号和分号。问题仍然存在!你想让我把整个代码发给你吗?很抱歉,stacktrace到底是什么?这个我还是新来的!我添加了所有代码,如果有帮助的话!在代码的底部,必须有一个名为logcat的选项卡。把它的内容贴在这里。或者向我发送代码LogCat中没有包含任何内容,但是我通过添加完整的代码编辑了我的初始帖子。我得到错误:构造函数Intentnew View.OnClickListener{},类未定义检查项目的src文件夹中是否有areacircle.java。并在您的清单中添加areacircleactivity