title: I can't get the elements in ArrayList
body: <p>Here My code for select values in Array-list Named Test i need to get values in Array-List Based on a Button Press Event But it shows Error given below</p>
  
  <pre><code>bn.setOnClickListener(new View.OnClickListener() {
  
  
          @Override
          public void onClick(View v) {
              d4 = ex.getText().toString();
              int i=test.size();
             for(int j=0;j&lt;=i;j++) {
                 String s= test.get(j).toString();
                 Toast.makeText(getApplicationContext(),s + " ", Toast.LENGTH_SHORT).show();
             }
  
          }
      });
  </code></pre>
  
  <p>Error Message Is given below</p>
  
  <pre><code> 04-04 16:38:29.551 28723-28723/com.example.web03.bulkmessenger E/MotionRecognitionManager: mSContextService = null
   04-04 16:38:29.551 28723-28723/com.example.web03.bulkmessenger E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@3e5f9413
   04-04 16:38:32.051 28723-28723/com.example.web03.bulkmessenger E/AndroidRuntime: FATAL EXCEPTION: main
   Process: com.example.web03.bulkmessenger, PID: 28723
   java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
   at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
   at java.util.ArrayList.get(ArrayList.java:308)
   at com.example.web03.bulkmessenger.MessengerActivity$3.onClick(MessengerActivity.java:127)
   at android.view.View.performClick(View.java:5246)
   at android.widget.TextView.performClick(TextView.java:10573)
   at android.view.View$PerformClick.run(View.java:21256)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:145)
   at android.app.ActivityThread.main(ActivityThread.java:6912)
   at java.lang.reflect.Method.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
  </code></pre>
  
  <p>thanks for help in advance</p>