OnClickListener cannot be resolved to a type
如图错误见上。
如图错误见上。
2015-04-26
/** * MainActivity实现了OnClickListener接口, 通过v.getId来分别实现对应的监听事件 * * @author nick * */ public class MainActivity extends Activity implements OnClickListener { private Button mBtnLogin; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mBtnLogin = (Button) findViewById(R.id.btn_login); mBtnLogin.setOnClickListener(this); } @Override public void onClick(View v) { // TODO Auto-generated method stub Log.i("nick", "click!"); } }
举报