- What is an Intent in Android?
- Can someone elaborate with an example?
- What are the types of Intents, and why we are using them?
- Why are Intents so important in Android?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
what is Intent ?
It is a kind of message or information that is passed to the components. It is used to launch an activity, display a web page, send sms, send email etc.
There are two types of intents in android:
Implicit intent is used to invoke the system components
Explicit intent is used to invoke the activity class.
Intent intent = newIntent (this, SecondActivity.class);
you can read more
http://www.vogella.com/tutorials/AndroidIntent/article.html#intents_overview http://developer.android.com/reference/android/content/Intent.html
An intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an Activity, broadcastIntent to send it to any interested BroadcastReceiver components, and startService(Intent) or bindService(Intent, ServiceConnection, int) to communicate with a background Service.
For more details see these links :
1). http://developer.android.com/reference/android/content/Intent.html
2) http://developer.android.com/guide/topics/intents/intents-filters.html
3). http://www.vogella.de/articles/AndroidIntent/article.html
there are many more articles are available.
From the paper
Deep Dive into Android IPC/Binder Framework atAndroid Builders Summit 2013
linkThe intent is understood in some small but effective lines
From this thread a simple answer of android architect Dianne Hackborn states it as a
data container
which it actually is.From android architecture point of view :
Intent is a data container that is used for inter process communication. It is built on top of the
Binder
from android architecture point of view.What is an Intent ?
An Intent is basically a message that is passed between components (such as Activities, Services, Broadcast Receivers, and Content Providers). So, it is almost equivalent to parameters passed to API calls. The fundamental differences between API calls and invoking components via intents are:
Of course, Intents can be made to work exactly like API calls by using what are called explicit intents, which will be explained later. But more often than not, implicit intents are the way to go and that is what is explained here.
One component that wants to invoke another has to only express its intent to do a job. And any other component that exists and has claimed that it can do such a job through intent-filters, is invoked by the Android platform to accomplish the job. This means, neither components are aware of each other's existence but can still work together to give the desired result for the end-user.
This invisible connection between components is achieved through the combination of intents, intent-filters and the Android platform.
This leads to huge possibilities like:
Here are additional technical details about Intents from the Android documentation.
Learn more
To understand intents basically I would suggest you to go through the site: http://developer.android.com/guide/topics/intents/intents-filters.html
Also, I've discussed about intents with examples in my personal blog: http://androiddesk.wordpress.com/2011/12/24/explicit-intent/
http://androiddesk.wordpress.com/2012/01/13/implicit-intent/
Just have a look if you think would be useful..
Thank you
After writing a single activity, there comes a need to transition to another activity to perform another task either with or without information from the first activity.
Android platform allows transition by means of Intent Interface.
Words are taken from here: Using Intent Demo and i suggest you to go through this example because they also have provided a code file as well. so you can use it and easily understand the same.