Android Tutorial 2 – Launch another Activity from Button



http://www.mimirsoft.com In this tutorial, I cover how to create a button in an activity to launch another activity.
UPDATED 2016/08/17
Download it from my website http://mimirsoft.com/wp-content/uploads/2011/06/Tutorial2.zip

follow me on twitter at https://twitter.com/KevinMilhoan if you would like more, or have requests.

Related Posts

41 Comments

  1. Hi thanx for the video. I'd like to do this same thing but inside of a tab, the problem is that i'm not able to make it work. I know it's not the subject of this video but could anyone help me? I would really appreciate it.

  2. java.lang.ClassCastException: com.transfig.m1
    12-07 06:04:51.412: E/AndroidRuntime(418):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at android.os.Handler.dispatchMessage(Handler.java:99)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at android.os.Looper.loop(Looper.java:123)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at java.lang.reflect.Method.invokeNative(Native Method)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at java.lang.reflect.Method.invoke(Method.java:521)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at dalvik.system.NativeStart.main(Native Method)
    12-07 06:04:51.412: E/AndroidRuntime(418): Caused by: java.lang.ClassCastException: com.transfig.m1
    12-07 06:04:51.412: E/AndroidRuntime(418):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
    12-07 06:04:51.412: E/AndroidRuntime(418):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
    12-07 06:04:51.412: E/AndroidRuntime(418):     … 11 more
    12-07 06:05:13.833: I/Process(418): Sending signal. PID: 418 SIG: 9

  3. Good tutorial too btw, I had a couple issues but quickly figured them out. My only real question though is, why not give the button on activity2 the ability to go back to tutorial2 instead of using back button and android?

  4. It looks like a lot of people have issues getting these 'red lines' or errors. You should have explained that you have to import libraries.. you can't just run your code and expect it to work without included these. details mate

  5. Didn't liked that tutorial. You only show people what you have wrote. I rewrite your code and keep seeing red lines. You even dont show what you included to the code. Next time please do step-by-step tutorials…

  6. Because Java is not HTML? HTML is a stactic format for displaying information. The actual work of turning HTML into an image on your screen is done by your browser, not by the HTML page. In android, it is more like writting the browser, page, and how the browser works the page all in one. Completely different paradigm.

Leave a Reply

Your email address will not be published.

© 2022 Code As Pro - Theme by WPEnjoy · Powered by WordPress