How do I share a variable among multiple methods?
<p>after saved instance I need share "int audio" to check() method to do several operations. I've an "info" option: when I click I see info dialog and I'd like listen audio (stop it when I click on "cancel"). But when I rotate emulator, I've another audio stars.</p>

<pre><code>int audio;
static int Info;

@Override
public void onCreate(Bundle savedInstanceState){ 
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
int Info = savedInstanceState.getInt("dialoginfo");
int audio = savedInstanceState.getInt("audio");
}

if(Info != 0)
  {
      Info();
}

private void Info(){
    Info = 1;
    sobCheck();
    LayoutInflater li = LayoutInflater.from(this);
    View view = li.inflate(R.layout.info, null);
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setView(view).create();
    TextView text=(TextView) findViewById(R.id.infoView1);
    builder.setCancelable(false); 
    builder.setPositiveButton("Chiudi", new DialogInterface.OnClickListener() {  
           public void onClick(DialogInterface dialog, int id) {  
               Info = 0;
               mp.stop();
               mp.reset();
               mp.release();
                mp = null;
                audio = 0;                  
               dialog.cancel();
        }  
        });  
    builder.show();
        }


private void sobCheck(){
if (audio == 0){
mp = MediaPlayer.create(this, R.raw.sob);
mp.start();
audio = 1;
}



protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt("audio", a);
</code></pre>

<p>after rotate screen, "audio" is always "0"</p>
