Note that there are some explanatory texts on larger screens.

plurals
  1. POArray Index Out of Bounds Exception - Android
    primarykey
    data
    text
    <p>I'm getting an array out of bounds error. I'm setting the array values in the try/catch block so I'm not really sure why I'm getting an array out of bounds error.</p> <pre><code>private static String profileName; private String identity = null; private String address = null; private boolean valid = false; private int profileId; public String fullName=""; private LinkedHashMap&lt;String, String&gt; nameValues = new LinkedHashMap&lt;String, String&gt;(0); public Profile(){ try { String[] subNames = fullName.split("@"); this.profileName = subNames[0]; this.identity = subNames[1]; this.address = subNames[2]; this.valid = true; } catch (Exception ex) { Log.w(LOG_TAG, "Invalid profile, " + ex); this.valid = false; } } </code></pre> <p>Putting Value Code:</p> <pre><code>public String getAttributeValue(String key){ return nameValues.get(key); } public void addAttribute(String key, String value){ nameValues.put(key, value); } </code></pre> <p>Here is the stack trace I'm getting from this issue:</p> <pre><code>01-11 01:37:20.721: I/ActivityThread(1759): Pub com.whooznear.android: com.whooznear.android.ProfileProvider 01-11 01:37:21.142: D/dalvikvm(1759): GC_FOR_ALLOC freed 42K, 4% free 6337K/6595K, paused 139ms 01-11 01:37:21.174: I/dalvikvm-heap(1759): Grow heap (frag case) to 6.805MB for 588816-byte allocation 01-11 01:37:21.472: D/dalvikvm(1759): GC_CONCURRENT freed 8K, 4% free 6903K/7175K, paused 20ms+14ms 01-11 01:37:24.974: D/dalvikvm(1759): GC_FOR_ALLOC freed 603K, 11% free 6666K/7431K, paused 81ms 01-11 01:37:25.142: D/dalvikvm(1759): GC_CONCURRENT freed &lt;1K, 4% free 7167K/7431K, paused 6ms+14ms 01-11 01:37:25.642: W/Profile(1759): Invalid profile, java.lang.ArrayIndexOutOfBoundsException: index=1 length=1 01-11 01:46:21.692: W/IInputConnectionWrapper(1759): showStatusIcon on inactive InputConnection 01-11 01:46:25.836: D/dalvikvm(1759): GC_EXPLICIT freed 384K, 6% free 7110K/7559K, paused 9ms+5ms </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload