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