Idle -> Prepared -> Started -> Pause -> Stopped
object data type, variable name = object data type. factory method name(input arguments);
static method
MediaPlayer.create(context, R.raw.song);
Non-static (regular) Method
myMediaPlayer.start();
listView.setAdapter(adapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id){ mMediaPlayer = MediaPlayer.create(NumbersActivity.this, R.raw.number_one); mMediaPlayer.start(); } });
@Override public String toString(){ return "Word{" + "mDefaultTranslation='" + mDefaultTranslation + '\'' + ", mMiwokTranslation='" + mMiwokTranslation + '\'' + ", mAudioResourceId=" + mAudioResourceId + ", mImageResourceId=" + mImageResourceId + '}'; } Word word = words.get(position); Log.v("NumbersActivity", "Current word: " + word); mMediaPlayer = MediaPlayer.create(PhrasesActivity.this, word.getAudioResourceId()); mMediaPlayer.start(); } });