
通常,您只能使用
this。但是,有时
this会引用一个内部类…因此,例如:
Button button = (Button)findViewById(R.id.ticket_details_sell_ticket);button.setonClickListener(new onClickListener() { @Override public void onClick(View v) { // it will be wrong to use only "this", because it would // reference the just created onClickListener object Intent login = new Intent(ClassName.this, Login.class); startActivityForResult(login, LOGIN_REQUEST); }});欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)