title: Can't use for loop to setOnClickListener for buttons or textview?
body: <p>I have A LOT of textviews/buttons that are clickable. It just makes the development process tedious if I have to type:</p>
  
  <pre><code>OnCreate... etc, etc.
      tvOutput0.setOnClickListener(this);
      tvOutput1....
      tvOutput2.....
      ...
      tvOutput100.setOnClickListener(this)
  </code></pre>
  
  <p>I tried to implement a for loop</p>
  
  <pre><code>   tvOutputArray[] = {tvOutput0, tvOutput1,....TvOutput100}
     for(int i=0; i&lt; tvOutputArray.length-1;i++){
           tvOutputArray[i].setOnClickListener(this);
     }
  </code></pre>
  
  <p>Alas, it crashes every single time. I attempt this.  Is there another way to do this besides manually (that is typing each and every single one out?</p>
  
  <pre><code>  12-29 08:42:58.120: ERROR/StrictMode(597): null
      android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService        has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40cd0fb0 that was originally       bound here
      at android.app.LoadedApk$ServiceDispatcher.&lt;init&gt;(LoadedApk.java:969)
      at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
      at android.app.ContextImpl.bindService(ContextImpl.java:1418)
      at android.app.ContextImpl.bindService(ContextImpl.java:1407)
      at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
      at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
      at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
      at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:191)
      at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1850)
      at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
      at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
      at android.os.AsyncTask$2.call(AsyncTask.java:287)
      at java.util.concurrent.FutureTask.run(FutureTask.java:234)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
      at java.lang.Thread.run(Thread.java:856)
  </code></pre>