Arrayindex out of bound android
<p>i have take one string array which stored date in format of "2012-04-26T08:38:00". i need two time difference so i have split string from "<strong>T</strong>" and store it in array 
so now </p>

<pre><code>at array index 0 = 2012-04-26
and array index 1 = 08:38:00
</code></pre>

<p>now from that 1st index i split with ":" so it stored like</p>

<pre><code>[0] = 08
[1] = 38
[2] = 00
</code></pre>

<p>now when i minus current time from this it gave me good output yesterday but now it raise error.</p>

<pre><code> 04-25 17:32:34.103: WARN/System.err(4292): java.lang.ArrayIndexOutOfBoundsException: index=1 length=1
04-25 17:32:34.103: WARN/System.err(4292):     at com.housedisplay.ListViewCustomAdapter.getView(ListViewCustomAdapter.java:83)
04-25 17:32:34.103: WARN/System.err(4292):     at android.widget.AbsListView.obtainView(AbsListView.java:1964)
04-25 17:32:34.113: WARN/System.err(4292):     at android.widget.ListView.makeAndAddView(ListView.java:1756)
04-25 17:32:34.113: WARN/System.err(4292):     at android.widget.ListView.fillDown(ListView.java:656)
04-25 17:32:34.113: WARN/System.err(4292):     at android.widget.ListView.fillFromTop(ListView.java:716)
04-25 17:32:34.113: WARN/System.err(4292):     at android.widget.ListView.layoutChildren(ListView.java:1609)
04-25 17:32:34.123: WARN/System.err(4292):     at android.widget.AbsListView.onLayout(AbsListView.java:1794)
04-25 17:32:34.123: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.123: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.123: WARN/System.err(4292):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912)
04-25 17:32:34.123: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.123: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.123: WARN/System.err(4292):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912)
04-25 17:32:34.133: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.133: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.133: WARN/System.err(4292):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
04-25 17:32:34.133: WARN/System.err(4292):     at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1527)
04-25 17:32:34.144: WARN/System.err(4292):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1316)
04-25 17:32:34.144: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.144: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.144: WARN/System.err(4292):     at android.widget.FrameLayout.onLayout(FrameLayout.java:400)
04-25 17:32:34.144: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.154: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.154: WARN/System.err(4292):     at com.google.android.maps.MapView.onLayout(MapView.java:764)
04-25 17:32:34.154: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.163: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.163: WARN/System.err(4292):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912)
04-25 17:32:34.163: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.163: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.163: WARN/System.err(4292):     at android.widget.FrameLayout.onLayout(FrameLayout.java:400)
04-25 17:32:34.173: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.183: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.183: WARN/System.err(4292):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
04-25 17:32:34.183: WARN/System.err(4292):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403)
04-25 17:32:34.183: WARN/System.err(4292):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1314)
04-25 17:32:34.183: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.183: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.193: WARN/System.err(4292):     at android.widget.FrameLayout.onLayout(FrameLayout.java:400)
04-25 17:32:34.193: WARN/System.err(4292):     at android.view.View.layout(View.java:9330)
04-25 17:32:34.193: WARN/System.err(4292):     at android.view.ViewGroup.layout(ViewGroup.java:3795)
04-25 17:32:34.203: WARN/System.err(4292):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1201)
04-25 17:32:34.203: WARN/System.err(4292):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1944)
04-25 17:32:34.203: WARN/System.err(4292):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 17:32:34.213: WARN/System.err(4292):     at android.os.Looper.loop(Looper.java:126)
04-25 17:32:34.213: WARN/System.err(4292):     at android.app.ActivityThread.main(ActivityThread.java:3997)
04-25 17:32:34.213: WARN/System.err(4292):     at java.lang.reflect.Method.invokeNative(Native Method)
04-25 17:32:34.213: WARN/System.err(4292):     at java.lang.reflect.Method.invoke(Method.java:491)
04-25 17:32:34.213: WARN/System.err(4292):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
04-25 17:32:34.223: WARN/System.err(4292):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
04-25 17:32:34.223: WARN/System.err(4292):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p><strong>Code ::</strong> </p>

<pre><code>try {
            holder.imgViewLogo.setText(arr_ServiceNumber[position]);
            holder.txtViewTitle.setText(itemList[position]);

            stime = arr_ScheduledDepartureTime[position].split("T");
            sTime2  = stime[1].split(":");

            Date dt = new Date();
            int hours = dt.getHours();
            int minutes = dt.getMinutes();
            int myhour = Integer.parseInt(sTime2[0]);
            int mymin = Integer.parseInt(sTime2[1]);

            int onefire = Math.abs((myhour - hours) * 60);
            int total;
            if (onefire &gt;= 60) {
                total = onefire - Math.abs((mymin - minutes));
            } else {
                total = onefire + Math.abs((mymin - minutes));
            }
            holder.lstrw_btn_departure.setText(total + " min \n" + "("
                    + sTime2[0] + ":" + sTime2[1] + ")");
        } catch (Exception e) {
            e.printStackTrace();
        }
</code></pre>
