title: Play Background Sound in android applications
body: <p>I want to play background sound in my app which I made. Help me how can I do this?...Here is the entire code. </p>
  
  <pre><code>public class Numbers extends Activity {
      public static MediaPlayer mp = null;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_numbers);
          ViewPager viewPager = (ViewPager)findViewById(R.id.view_pager);
          ImagePagerAdapter adapter = new ImagePagerAdapter();
          viewPager.setAdapter(adapter);
      }
  
      private class ImagePagerAdapter extends PagerAdapter {
          private int[] mImages = new int[]{R.drawable.no1,R.drawable.no2,R.drawable.no3,R.drawable.no4,R.drawable.no5,R.drawable.no6,R.drawable.no7,R.drawable.no8,R.drawable.no9};
  
          @Override
          public int getCount() {
              return mImages.length;
          }
          @Override
          public boolean isViewFromObject(View view, Object object) {
              return view == ((ImageView) object);
          }
          @Override
          public Object instantiateItem(ViewGroup container, int position) {
              Context context = Numbers.this;
              ImageView imageView = new ImageView(context);
              int padding =context.getResources().  
              getDimensionPixelSize(R.dimen.activity_vertical_margin);
              imageView.setPadding(padding, padding, padding, padding);
              imageView.setScaleType(ImageView.ScaleType.CENTER);
              imageView.setImageResource(mImages[position]);
              ((ViewPager) container).addView(imageView, 0);
  
              @Override
              public void destroyItem(ViewGroup container, int position, Object object) {
                  ((ViewPager) container).removeView((ImageView) object);
              }
          }
      }//end of sub-class ImagePagerAdapter
  }//End of Numbers class
  </code></pre>
  
  <p>Just tell me what I need to add in this code to play background music which will be in loop mode till the app runs.</p>