Thursday 18 September 2014

Intents

Intent:
            1) Intent is a instant action.

                        2) Intent is a message  that is passed between the components(such as                    activity,content provider,services and content provider).
                          
                        3) Normally intents are used to pass the values between activity and to go from one activity to  another activity.

The main use of intent :

                       1)Start the service 

                       2)Launch the activity

                       3)Display a web page

                       4)Broadcast a message

                       5)Dial a  phone call

Types of Intents:
                 There are two types of intents in android ,they are 
                              
                       1)Implicit Intent

                       2)Explicit Intent



                                                                         

Implicit Intent
                 Implicit intents are used to provide the information of available components provided by the system that to be invoked.

                         For example you can use implicit intent coding  to view a webpage.
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.mobileapptechnology.blogspot.com"));
startActivity(i); 
Explicit Intent 
                 Explicit intents are used to provide the external class,used to move from one activity to other activity.

                        For example you can use the following code  to move from one activity to another activity.
  1. Intent i = new Intent(getApplicationContext(), ActivityTwo.class);  
  2. startActivity(i);  
                          

0 comments:

Post a Comment

Total Pageviews

Contact Form

Name

Email *

Message *

Mobile App Developer