1 / 5

Activity & Intent

Activity & Intent. Create an new Activity. Create a class extends from Activity Create a layout for the activity setContentView for the activity Configure the activity in the A ndroidManifest.xml file. Multiple Activities. Activity01. Activity02. startActivity (intent ). Intent. ……

zuzela
Download Presentation

Activity & Intent

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Activity & Intent Fall 2012 CS2302: Programming Principles

  2. Create an new Activity • Create a class extends from Activity • Create a layout for the activity • setContentView for the activity • Configure the activity in the AndroidManifest.xmlfile Fall 2012 CS2302: Programming Principles

  3. Multiple Activities Activity01 Activity02 startActivity(intent) Fall 2012 CS2302: Programming Principles

  4. Intent …… Intent intent = new Intent(); intent.setClass(Activity01.this, Activity02.class); startActivity(intent); …… Fall 2012 CS2302: Programming Principles

  5. Get information from Intent • In the Activity01.class • intent.putExtra(“one”,firstValue); • In the Activity02.class • intent.getStringExtra(“one”); Fall 2012 CS2302: Programming Principles

More Related