Type Cannot refer to a non-final variable Asortiment inside an inner class defined in a different method
<p>I add simple class to my application:</p>

<pre><code>public class Nomenklatura implements Serializable
    {
        private Boolean SmenaIsOpen=false;
        public Nomenklatura()
        {
            SmenaIsOpen=false;
        }
        public String OpenSmena()
        {
            SmenaIsOpen=true;
            return "ok";
        }
        public String CloseSmena()
        {
            return "ok";
        }
        public Boolean GetSmenaIsOen()
        {
            return SmenaIsOpen;
        }
        public void SetSmenaIsOen(Boolean val)
        {
            SmenaIsOpen=val;
        }

    }
</code></pre>

<p>Application should work with one object this class.
When I use it in activity:</p>

<pre><code>@Override
    protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.presmena);  
        Nomenklatura Asortiment;
         Asortiment=(Nomenklatura) getIntent().getExtras().getSerializable("Nomenklatura");
         Button but1=(Button) findViewById(R.id.button1);
            but1.setOnClickListener(new OnClickListener() 
            {
                @Override
                public void onClick(View arg0) 
                {
                    if(Asortiment.GetSmenaIsOen()) Asortiment.CloseSmena();
                    else Asortiment.OpenSmena();
                }
            });
    }
</code></pre>

<p>I get error: Cannot refer to a non-final variable Asortiment inside an inner class defined in a different method    Presmena.java.
Help to understand, what is wrong</p>
