FANDOM


An Android Intent is a "description of an action to be performed".

Is a message passing system

Allow for late binding between components

broadcast data with and between applications

how to listen for changes in system state

can be defined explicitly or implicitly, and used to start Activities or Services

Broadcast Intents are used to publish systemwise data

AttributesEdit

Intents use Primary and Secondary attributes

the primary attributes 


  • "action"
  • "data"

secondary attributes are "category", "type", "component" and "extras"

DescriptionEdit

Intents can be used to trigger other applications to do something. generally this would involve opening up the Camera, or Contacts, or SMS application, in order to have that component perform some functionality that you require for your own application purposes.

Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

startActivity(i);

this will cause the default Camera application to launch

Intents can be called Explicitly or Implicitly.

Explicitly providing the class to loadEdit

Explicit intents have specified a component via setComponent(ComponentName) or setClass(Context, Class) which provides the exact class to run

Intent intent = new Intent(MyActivity.this, MyOtherActivity.class);
startActivity(intent);


Implicitly requesting an Action be performedEdit

In order for your application to use the Image that is returned by the camera app, you need to tell the Intent how to return the result like so;

final static int CAMERA_RESULT = 0;

startActivityForResult(i, CAMERA_RESULT);

Is this an over-ridden method??? @todo

protected void onActivityResult(
     int requestCode, 
     int resultCode, 
     Intent intent) 
        {

  super.onActivityResult(requestCode, resultCode, intent);

  if (resultCode == RESULT_OK)
    {
      Get Bundle extras = intent.getExtras();
      Bitmap bmp = (Bitmap) extras.get("data");
      imv = (ImageView) findViewById(R.id.ReturnedImageView);
      imv.setImageBitmap(bmp);
    }
  }

broadcastActivityEdit

Allows sending an Intent to any interested broadcast Receivers

wfdw

fe



bindServiceEdit

To communicate with an already running service

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.