Here is my Android
Media player code. I don\'t know what I am missing in this code, when I run with breakpoint at line MediaPlayer mp = new MediaPlayer()<
You didn't call the Activity
's onCreate()
method, i.e the super class' one. Add the call to MainActivity
's onCreate()
method:
public class MainActivity extends Activity {
private MediaPlayer mp;
private static final String MAIN_TAG ="ERROR";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); // this line is missing
// your code below ...