getting value of variable from anonymous function , final dosn't work
<p>hallo all</p>

<p>I'm trying to send a value i have in my outer scope to my function on button click,
but when i run in debug mode i see the value of the variable is empty although during the build of the button it had a value. here is my code:</p>

<pre><code>try 
    {
        String name = album.getString("name");
        final String albumId = album.getString("albumID");
        Button btnAlbum = new Button(this);
        btnAlbum.setText(name);
        btnAlbum.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));

        btnAlbum.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

                GetImages (albumId);
            }
        });

        albumHolder.addView(btnAlbum);
    } 
</code></pre>

<p>so what i mean is the variable: "albumId" which i am trying to pass to a function on the click event.</p>

<p>forgot to mention that my function is being called from within a for loop...</p>

<p>thanks in advanced </p>
