The type new View.OnClickListener(){} must implement the inherited abstract method View.Onclicklis


public class MainActivity extends Activity {
protected Button startBrew = null;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
startBrew = (Button) findViewById(R.id.brew_start);
startBrew.setOnClickListener(new StartButtonListener());
}

class StartButtonListener implements android.view.View.OnClickListener {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
findViewById(R.id.textView0).setBackgroundColor(Color.BLUE);
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM