Android - Intents

Card Set Information

Author:
javatomas
ID:
234570
Filename:
Android - Intents
Updated:
2013-09-13 18:39:38
Tags:
intents
Folders:

Description:
Android Intents
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user javatomas on FreezingBlue Flashcards. What would you like to do?


  1. What are Intents?
    Intents are asynchronous messages which allow application components to request functionality from other Android components.

    Intents allow you to interact with  components from the own and other  applications. For example an activity can start an external activity for taking a picture.
  2. How you can start another Activity via an intent?
    • # Start the activity connect to the
    • # specified class

    • Intent i = new Intent(this, ActivityTwo.class);
    • startActivity(i);
  3. Could you start a service via Intents?
    Yes using startService(Intent) method.
  4. Intents are used to <1.> to the Android system that a certain <2.> has <3.>
    • 1. Signal
    • 2. Event
    • 3. Occurred
  5. What are implicit intents?
    Implicit intents do not name a target (the field for the component name is blank).

    Implicit intents specify the action which should be performed and optionally data which provides data for the action.

    For example the following tells the Android system to view a webpage.

    • Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vogella.com"));
    • startActivity(i);
  6. When to use an Implicit Intent?
    Implicit intents are often used to activate components in other applications.
  7. What are Explicit intents
    Explicit intents explicitly defines the component which should be called by the Android system, by using the Java class as identifier.

    • The following shows how to create an explicit intents and send it to the Android system.
    • Intent i = new Intent(this, ActivityTwo.class);
    • i.putExtra("Value1", "This value one for ActivityTwo ");
    • i.putExtra("Value2", "This value two ActivityTwo");
  8. When to use an Explicit Intent?
    explicit intents are typically used for application-internal messages — such as an activity starting a subordinate service or launching a sister activity.

What would you like to do?

Home > Flashcards > Print Preview