package com.example.buttontest;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void doSomething(View v) {
Log.d("Krishna","button was clicked");
}
}
当我写方法时
public void doSomething(View v) { Log.d("Krishna","button was clicked"); }
在上述方法中,出现了 2 个错误
- 视图无法解析为类型
- 无法解析日志。
请告诉如何解决此构建错误