Try this:

MediaPlayer mPlayer = new MediaPlayer();
mPlayer.setDataSource(this,mUri);
mPlayer.setOnPreparedListener(this);
mPlayer.setOnErrorListener(this);
mPlayer.prepareAsync();

private void onPrepared(MediaPlayer mp)
{
    mp.start();
}

private void onError(MediaPlayer mp, int a, int b)
{
  //Grab and display error code here
}

Could be a network connectivity issue.

On Aug 31, 4:18 pm, Andrea Stagi <stagi.and...@gmail.com> wrote:
> Hi all,
>
> I'm trying to stream from an url using this code
>
>         MediaPlayer mediaPlayer =
> MediaPlayer.create(getApplicationContext(), Uri.parse("http://
> voxsc1.somafm.com:8880"));
>         mediaPlayer.start();
>
> This code works on emulator, on my htc wildfire with 2.3, on another
> wildfire with 2.2 and other devices, but I get a NullPointer Exception
> with an LG and a GalaxyTab running 2.2 ... Tried other solutions,
> using prepared listener too, but nothing changes ... Why this??
>
> Thank you in advance,
>
> =.4.S.=

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to