Problem accessing variable[] from another class
<p>I know this a pretty basic question, and already found another ones like mine, but I honestly don't know what I'm doing wrong.</p>

<pre><code>public class InteractiveArrayAdapter extends ArrayAdapter&lt;Model&gt; {

    private final List&lt;Model&gt; list;
    private final Activity context;

    public int teste;

    public InteractiveArrayAdapter(Activity context, List&lt;Model&gt; list) {
        super(context, R.layout.rowbuttonlayout, list);
        this.context = context;
        this.list = list;

    }

    public int getTest()
    {
        return teste;
    }

    static class ViewHolder {
        protected TextView text;
        protected CheckBox checkbox;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        teste = 2;
....
}
}
</code></pre>

<p>and other class:</p>

<pre><code>try{

                InteractiveArrayAdapter adapt = new InteractiveArrayAdapter(this,
            getAPPS(0));
                int test = adapt.getTest();
                Toast.makeText(this, Integer.toString(test), Toast.LENGTH_LONG).show();
                Log.v("TAG",Integer.toString(test));
            }catch(Exception e)
                {
                Log.v("EXCEPTION",e.toString());
            }
</code></pre>

<p>EDIT:  I was getting null for a stupid mistake, and now I'm getting the primitive and expected 0 as most of you say.</p>

<p>At some point of my app, everytime a checkboxes is clicked that method getView is executed. I want to store that to an array[] of strings progressively (i+1) (i just put int to be easier to understand - realize now it was a mistake), and then when users inputs ok I want to access the whole array. Wondering if it's possible the way I want.</p>

<p>So when I do this</p>

<pre><code>InteractiveArrayAdapter adapt = new InteractiveArrayAdapter(this,
                getAPPS(0));
</code></pre>

<p>This is meaningless, because I don't need to execute anything again, I just want to retrieve the created array - if possible!</p>
