In my app, i want to play sound when a user is moving a tile, i added the following code --
private void moveTile(Tile tile, Cell cell) {
grid.field[tile.getX()][tile.getY()] = null;
grid.field[cell.getX()][cell.getY()] = tile;
tile.updatePosition(cell);
MediaPlayer mp = null;
if(mp!=null) {
mp.release();
}
mp = MediaPlayer.create(mContext,R.raw.movetile);
mp.start();
}
But whenever i am moving the first tile, the app is not responding, its not crashing also, any help.