title: Android - Spinner + setOnClickListener
body: <p>So, i want to assign a Spinner OnClick, but i get the following error</p>
  
  <pre><code>     java.lang.RuntimeException: Don't call   setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead
  </code></pre>
  
  <p>I need it to collect data when i click the spinner, then use it later.
  I know i did it before, but i lost the code. Googled for an answer, i didn't find anything that works. 
  If this helps, I am using pagerview layout.
  Here is my code:</p>
  
  <pre><code>     public class DATA extends Fragment {
           public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          if (container == null) {
              return null;
          }
  
    ScrollView GPU_LAYOUT = (ScrollView)inflater.inflate(R.layout.gpu, container, false);
  
        final TextView higher_than =(TextView) GPU_LAYOUT.findViewById(R.id.gpu_higher_than_value);
  
          final Spinner min_max =(Spinner) GPU_LAYOUT.findViewById(R.id.min_max_spinner_gpulay);  
  
          min_max.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
                  String TMP=min_max.getSelectedItem().toString();
                  higher_than.setText(TMP);
              }
          });
  
         return GPU_LAYOUT;
        }
  </code></pre>
  
  <p>Is there any way i can do it? Thank you!</p>