Error While Calling Activity from Service
<p>i have written this code of service class for calling the activity from the service..but it not works.....please help me.......</p>

<pre><code>public class MyService extends Service {
private static final String TAG = "MyService";
MediaPlayer player;
Uri u1 ;

@Override
public IBinder onBind(Intent intent) {
    return null;
}

@Override
public void onCreate() {
    Intent intent = null;
    int startId = 0;
    super.onStart(intent, startId);
    Toast.makeText(this, "My Service Created", Toast.LENGTH_LONG).show();
    Log.d(TAG, "onCreate");

//Intent i=new Intent(MyService.this,CustomDialogExample.class);
//i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//startActivity(i);

}   


//player = MediaPlayer.create(this, u1.parse("http://marakana.com/static/tut/braincandy.m4a")); 
//      player.setLooping(false); // Set looping
//      player.setLooping(false); // Set looping
//  

@Override
public void onDestroy() {
    Toast.makeText(this, "My Service Stopped", Toast.LENGTH_LONG).show();
    Log.d(TAG, "onDestroy");
    player.stop();
}

@Override
public void onStart(Intent intent, int startid) {

    Intent i=new Intent().setClass(MyService.this,CustomDialogExample.class);
        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(i);
    Toast.makeText(this, "My Service Started", Toast.LENGTH_LONG).show();
    Log.d(TAG, "onStart");
    //player.start();
}
  }
</code></pre>
