首页 新闻 会员 周边 捐助

我这里一直报错MyButtonListener cannot be resolved to a type怎么回事

1
[待解决问题]

public class Activity02 extends ActionBarActivity {

private Button myButton = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myButton = (Button)findViewById(R.id.myButton);
myButton.setOnClickListener(new MyButtonListener());

if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}

class MyButtonListener implements Button.OnClickListener{

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent= new Intent();
intent.setClass(Activity02.this, OtherActivity.class);
Activity02.this.startActivity(intent);


}

}
}

问题补充:

myButton.setOnClickListener(new MyButtonListener());花线的地报错

追梦天涯的主页 追梦天涯 | 初学一级 | 园豆:199
提问于:2015-07-23 15:25
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册