title: Android MediaPlayer Problems :"Error (-38 , 0) " and "stop called in state 1"
body: <p>It's no sound from my device even the emulator.<br></p>
  
  <p>Actually, at the line <b>"mMediaPlayer.create(this, musicIds[0]); "</b> , eclipse suggests me two choices : <i>"Change access to static using 'MediaPlayer'(declaring type)"</i> or <i>"Add @SuppressWarnings 'static-access' to on Create()"</i>. By the way, I take eclipse's suggestions........but still don't work.<br></p>
  
  <p>P.S. I called a package from other project (pager).</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      setTitle(R.string.diff_title);
      setContentView(R.layout.title_layout);    
  
  
      viewFlow = (ViewFlow) findViewById(R.id.viewflow);
      DiffAdapter adapter = new DiffAdapter(this);
      viewFlow.setAdapter(adapter);  
      TitleFlowIndicator indicator = (TitleFlowIndicator) findViewById(R.id.viewflowindic);
      indicator.setTitleProvider(adapter);
      viewFlow.setFlowIndicator(indicator);
  
  
      //Set all views
      listView = (ListView) findViewById(R.id.listView1);
      listView.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, listeStrings));
      final ImageView imv=(ImageView)findViewById(R.id.imv);
      imv.setImageResource(imageIds[0]);
      final ImageView pic = (ImageView)findViewById(R.id.Picture);
      pic.setImageResource(imageIds[0]);
  
      btnPlay = (ImageButton)findViewById(R.id.btnplay);
      btnPlay.setOnClickListener(this);
  
      btnNext = (ImageView)findViewById(R.id.imvnext);
      btnLast = (ImageView)findViewById(R.id.imvlast);        
      final TextView textview = (TextView)findViewById(R.id.textView2);
      textview.setText(listeStrings[0]);  
      seekBar = (SeekBar)findViewById(R.id.seekbar);
      //seekBar.setMax(mMediaPlayer.getDuration());
  
      mMediaPlayer.create(this, musicIds[0]);
  
      try {
             if (mMediaPlayer != null) {
                 mMediaPlayer.stop();
             }
             mMediaPlayer.prepare();
             mMediaPlayer.start(); 
      } catch (IllegalStateException e) {
             e.printStackTrace();
      } catch (IOException e) {
             e.printStackTrace();
      }
  
      listView.setOnItemClickListener(new OnItemClickListener() {
  
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              int songIndex = position;
              String songTitle=musicNames[position];
              imv.setImageResource(imageIds[position]);
              pic.setImageResource(imageIds[position]);
              textview.setText(listeStrings[position]);
  
          }
      });
  
  
  }
  
  
  }
  </code></pre>
  
  <p>And this is my logcat:</p>
  
  <pre><code>08-11 07:33:19.217: E/MediaPlayer(338): stop called in state 1
  08-11 07:33:19.217: E/MediaPlayer(338): error (-38, 0)
  08-11 07:33:19.217: E/MediaPlayer(338): prepareAsync called in state 0
  08-11 07:33:19.217: W/System.err(338): java.lang.IllegalStateException
  08-11 07:33:19.227: W/System.err(338):  at android.media.MediaPlayer.prepare(Native Method)
  08-11 07:33:19.227: W/System.err(338):  at org.taptwo.android.widget.viewflow.example.DiffViewFlowExample.onCreate(DiffViewFlowExample.java:95)
  08-11 07:33:19.227: W/System.err(338):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  08-11 07:33:19.227: W/System.err(338):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
  08-11 07:33:19.227: W/System.err(338):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
  08-11 07:33:19.227: W/System.err(338):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  08-11 07:33:19.227: W/System.err(338):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
  08-11 07:33:19.227: W/System.err(338):  at android.os.Handler.dispatchMessage(Handler.java:99)
  08-11 07:33:19.227: W/System.err(338):  at android.os.Looper.loop(Looper.java:123)
  08-11 07:33:19.227: W/System.err(338):  at android.app.ActivityThread.main(ActivityThread.java:3683)
  08-11 07:33:19.227: W/System.err(338):  at java.lang.reflect.Method.invokeNative(Native Method)
  08-11 07:33:19.227: W/System.err(338):  at java.lang.reflect.Method.invoke(Method.java:507)
  08-11 07:33:19.227: W/System.err(338):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  08-11 07:33:19.227: W/System.err(338):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  08-11 07:33:19.227: W/System.err(338):  at dalvik.system.NativeStart.main(Native Method)&lt;br&gt;
  08-11 07:33:19.257: E/MediaPlayer(338): Error (-38,0)
  </code></pre>