Android : How to reference button for onClickListener?

on Friday, July 11, 2014


I am trying to create an Android app, and i want to create a on click listener, here is what I have so far.



public void amazonListener() {
amazonButton = (Button) findViewById(R.id.amazonButton);
}


As you see, i am in the very early stages, but where I first referenced amazonButton (before the = sign) button, it turns into red text and it says Cannot resolve symbol 'amazonButton'. Also, I have referenced this method in the onCreate method


0 comments:

Post a Comment