Intents:
Intents is used to provide communication between activity to activity, activity 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.
Intents is used to provide communication between activity to activity, activity 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.
- setAction()
- setData()
- putExtras()
- getExtras()
Syntax:
Intent i=new Intent();
i.setAction(Intent.ACTION_NAME());
No comments:
Post a Comment