java - Android - Execution failed for task ':app:compileDebugJava' with ';' expected -
im fresher in android app dev... using android studio 1.3, jdk 8
event log : 12:44:13 gradle build finished in 13s 724ms 12:59:50 executing tasks: [:app:assembledebug] 12:59:55 gradle build finished 2 error(s) in 5s 804ms
gradle build: error:(41, 31) error: ';' expected error:execution failed task ':app:compiledebugjava'.
compilation failed; see compiler error output details. information:build failed
information:total time: 5.088 secs
information:2 errors
information:0 warnings
information:see complete output in console
java class code:
package in.co.doordie.shankar.doordie; import android.app.activity; import android.content.intent; import android.media.mediaplayer; import android.os.bundle; public class splash extends activity { mediaplayer oursong; @override protected void oncreate(bundle doordiesplash) { super.oncreate(doordiesplash); setcontentview(r.layout.splash); oursong = mediaplayer.create(splash.this, r.raw.kalyanamala); oursong.start(); thread timer = new thread() { public void run() { try { sleep(50000); } catch (interruptedexception e) { e.printstacktrace(); } { intent openstartingpoint = new intent("in.co.doordie.shankar.doordie.mainactivity"); startactivity(openstartingpoint); } } }; timer.start(); @override protected void onpause(){ super.onpause(); oursong.release(); finish(); } } } help me ... know went wrong?
you have placed
@override protected void onpause(){ super.onpause(); oursong.release(); finish(); } inside oncreate(). move out.
next time select whole code , use shortcut ctrl-alt-l quick reformat code, easier find you.
package in.co.doordie.shankar.doordie; import android.app.activity; import android.content.intent; import android.media.mediaplayer; import android.os.bundle; public class splash extends activity { mediaplayer oursong; @override protected void oncreate(bundle doordiesplash) { super.oncreate(doordiesplash); setcontentview(r.layout.splash); oursong = mediaplayer.create(splash.this, r.raw.kalyanamala); oursong.start(); thread timer = new thread() { public void run() { try { sleep(50000); } catch (interruptedexception e) { e.printstacktrace(); } { intent openstartingpoint = new intent("in.co.doordie.shankar.doordie.mainactivity"); startactivity(openstartingpoint); } } }; timer.start(); } @override protected void onpause() { super.onpause(); oursong.release(); finish(); } }
Comments
Post a Comment