Friday, 30 August 2013

onResume() makes my application crash with no reason

onResume() makes my application crash with no reason

For some reason when i declare onResume() in my code it crashes my program
at the begining for no reason, it doesn't even open up.
This is my onResume() code :
public void onResume()
{
if(play==true)
{
if(playing==false)
{
if(numbl>0)
{
letter=thefull.substring(cur, cur+1);
if(letter.equals("m"))
{
oursong = MediaPlayer.create(MainActivity.this, R.raw.m);
oursong.start();
playing=true;
}
else if(letter.equals("a"))
{
oursong = MediaPlayer.create(MainActivity.this, R.raw.a);
oursong.start();
playing=true;
}
else if(letter.equals("r"))
{
oursong = MediaPlayer.create(MainActivity.this, R.raw.r);
oursong.start();
playing=true;
}
}
}
}
}
as soon as i remove onResume() the program runs just fine. Am i doing
something wrong?
Here is a look of my full code : http://pastebin.com/faVfFK6q
Thanks in advanced for the help.

No comments:

Post a Comment