Button onclick not firing the event in Android
<p>Here is my button on click listener. I am trying to listen to the onclick event firing. But it is not working. I have tried the method given in develop.android.com. But this method seems to be not working. Can anyone point out the mistake that I am doing here?</p>

<pre><code> public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
      Bundle args = getArguments();
      v = inflater.inflate(R.layout.product_fragment, container, false);          
    Button button = (Button) v.findViewById(R.id.buynow_button);
     button.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            Toast.makeText(getActivity(), "test", 2000);
        }
    });
    return v;
   }
</code></pre>
