String Array doesn't show the expected value
<p>I have a String array initialized globally Like:</p>

<pre><code>String[] links={""};
</code></pre>

<p>in an onclick listener i m putting some values in it using a for loop</p>

<pre><code>links = new String[Link.size()];
String[] news = new String[Catagory.size()];
for (int k = 0; k &lt; Catagory.size(); k++) {

    news[k] = Catagory.get(k).toString();

    if (news[k].contentEquals("Android Apps")) {
        links[k] = Link.get(k).toString();
        Toast.makeText(getApplicationContext(), links[k],
                       Toast.LENGTH_LONG).show();
        SHOW.add("Title:" + "\n" + Title.get(k) + "\n"
                 + "Date:" + "\n"
                 + PubDate.get(k).replace("+0000", "") + "\n"
                 + "Content:" + "\n"
                 + Content.get(k).replace("&lt;br/&gt;", "") + "\n");
        Log.i("IF ELSE", Catagory.get(k));
    }
}
</code></pre>

<p>and its happening correctly. But when I call this array in onitemclick listener method then it shows Blank again:</p>

<pre><code>public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {
    Toast.makeText(getApplicationContext(), links[position], Toast.LENGTH_LONG).show();
}
</code></pre>

<p>How can i get the array values that i had those in the onclick listener?</p>
