android - Open Web Browser from App - Always Crashes -


i'm trying open web browser app using:

 intent browser = new intent(intent.action_view, uri.parse("http://developer.android.com/"));              startactivity(browser); 

but app crashes:

08-07 17:18:29.912: e/androidruntime(751): fatal exception: main 08-07 17:18:29.912: e/androidruntime(751): java.lang.nullpointerexception 08-07 17:18:29.912: e/androidruntime(751):  @ android.app.activity.startactivityforresult(activity.java:3131) 08-07 17:18:29.912: e/androidruntime(751):  @ android.app.activity.startactivity(activity.java:3237) 08-07 17:18:29.912: e/androidruntime(751):  @ com.co.drumkit$9.onclick(drumkit.java:658) 08-07 17:18:29.912: e/androidruntime(751):  @ android.view.view.performclick(view.java:3110) 08-07 17:18:29.912: e/androidruntime(751):  @ android.view.view$performclick.run(view.java:11934) 08-07 17:18:29.912: e/androidruntime(751):  @ android.os.handler.handlecallback(handler.java:587) 08-07 17:18:29.912: e/androidruntime(751):  @ android.os.handler.dispatchmessage(handler.java:92) 08-07 17:18:29.912: e/androidruntime(751):  @ android.os.looper.loop(looper.java:132) 08-07 17:18:29.912: e/androidruntime(751):  @ android.app.activitythread.main(activitythread.java:4123) 08-07 17:18:29.912: e/androidruntime(751):  @ java.lang.reflect.method.invokenative(native method) 08-07 17:18:29.912: e/androidruntime(751):  @ java.lang.reflect.method.invoke(method.java:491) 08-07 17:18:29.912: e/androidruntime(751):  @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:841) 08-07 17:18:29.912: e/androidruntime(751):  @ com.android.internal.os.zygoteinit.main(zygoteinit.java:599) 08-07 17:18:29.912: e/androidruntime(751):  @ dalvik.system.nativestart.main(native method) 


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -