Android save and load firstrun state
<p>In my app when user clicks a button, a male or a female sound is played. I want this: if at first run a male sound was played then also at the other clicks/runs a male sound is played. So no female voice ever. If at first run a female sound was played then also at the other clicks/runs a female sound is played. I do not mean just clicking the button, i mean everytime the user opens the app.</p>

<p>Here is my code for randomize and playing:</p>

<pre><code>    randNem = new Random();
    nem = randNem.nextInt(2)+0;
    NameButton = (Button)findViewById(R.id.Button01);
    NameButton.setOnClickListener(new View.OnClickListener() 
    {
        public void onClick(View v) 
        {
             if (nem == 0)
             {
                 mp = MediaPlayer.create(Main.this, R.raw.hellomyfriend_amy);   
                 mp.start();

                 mp.setOnCompletionListener(new OnCompletionListener() {

                     @Override
                     public void onCompletion(MediaPlayer mp) {

                         mp.release();
                         NameButton.setEnabled(true);
                     }

                 });

             }
             else if (nem == 1)
             {
                 mp = MediaPlayer.create(Main.this, R.raw.hellomyfriend_joey);   
                 mp.start();
                 mp.setOnCompletionListener(new OnCompletionListener() {

                     @Override
                     public void onCompletion(MediaPlayer mp) {

                         mp.release();
                         NameButton.setEnabled(true);
              }

                 });

             }


        }

    });
</code></pre>
