Saturday 15 May 2010

intents

Intents:

Intents is used to provide communication between activity to activityactivity to service, activity to broad cast receiver.

There are two types of Intents:

1. Explicit intents
2. Implicit intents

Explicit intents:

Defn:
 Explicit intents is used to call the user defined activities.

Syntax:
 Intent i=new Intent();
i.setComponent(new ComponentName(context, class_name));
startActivity(i); 

2 .Implicit Intents:

Implicit Intents is used to call the built in activities.

following methods are used to give additional properties to the Intenet.
  1.  setAction()
  2. setData()
  3. putExtras()
  4. getExtras()
Syntax:
 Intent i=new Intent();
i.setAction(Intent.ACTION_NAME());

No comments:

Post a Comment