Intent Brief

by Sunday, March 11, 2012 0 comments
Intent:
An intent is a mechanism for describing a specific action, such as “pick a photo” “phone home”.

Types:
There are 2 types of intents that Android understands.
1. Explicit Intent
2. Implicit Intent

In an Explicit intent, you actually specify the activity that is required to respond to the intent. In other words, you explicitly designate the target component. This is typically used for application internal messages.

In an Implicit intent (the main power of the android design), you just declare an intent and leave it to the platform to find an activity that can respond to the intent. Here, you do not declare the target component and hence is typically used for activating components of other applications seamlessly.

Examples:
Implicit intent:  
            String _web=web.getText().toString();
            Uri uri=Uri.parse("http://"+_web);

            Intent i=new Intent(Intent.ACTION_VIEW,uri);
            startActivity(i);


Explicit intent:
                 Intent myIntent1 = new Intent(kpnworld.this, webbwsr.class);
                 kpnworld.this.startActivity(myIntent1);

 

Unknown

Androider

Welcome to Android-Action Blog. I’m a normal guy, who is passionate about Mobile Coding. Here I am writing about Android. Happy learning

0 comments:

Post a Comment