Android Common face question

Source: Internet
Author: User
Tags message queue

    1. The life cycle of the activity when switching between the screen and the
      1). When you do not set the Activity's android:configchanges, the screen will recall the various lifecycles and will be executed once when the screen is cut, and will be executed two times when the vertical screen is cut.

2). When you set the Activity's android:configchanges= "orientation", the screen will recall the life cycle, and it will only be executed once when the screen is cut horizontally and vertically.

3). When you set the Activity's android:configchanges= "Orientation|keyboardhidden", the screen does not recall the individual lifecycles, only the Onconfigurationchanged method is executed.

What are the types of animations in 2.android, and what are their characteristics and differences?
Two kinds, one is Tween animation, and another is Frame animation. Tween animations that enable the view components to move, zoom in, zoom out, and create changes in transparency; Another Frame animation, the traditional animation method, through the sequence of playing the arranged picture to achieve, similar to the film.
3. What is the maximum number of bytes in a text message?
Chinese 70 (including punctuation), English 160, 160 bytes.

Principles of the 4.handler mechanism
Andriod provides Handler and Looper to meet the communication between threads. Handler first-out principle. The Looper class is used to manage the exchange of messages (message exchange) between objects within a particular thread.
1) Looper: A thread can produce a Looper object that manages this line thread message queue.
2) Handler: You can construct Handler objects to communicate with Looper in order to push new messages into the message Queue; or receive Looper from Message Queue).
3) Message queue (Message Queuing): Used to hold messages placed by the thread.
4) Thread: The UI thread is usually the main thread, and the Android launcher will create a Message Queue for it.
5. What is embedded real-time operating system and is the Android operating system part of the RTOs?

Embedded real-time operating system refers to when the external events or data generated, can be accepted and fast enough to be processed, the results of the processing can be within the specified time to control the production process or to respond quickly to the processing system, and control all real-time tasks coordinated operation of the embedded operating system. Mainly used in industrial control, military equipment, aerospace and other areas of the system response time has stringent requirements, which requires the use of real-time systems. Can be divided into soft real-time and hard real-time two kinds, and Android is based on the Linux kernel, and therefore belongs to soft real-time.

6.android thread and threads, how processes communicate with processes
1), when an Android program starts running, a process is started separately.
By default, all Activity or Service in this program will run in this process.
By default, an Android program has only one process, but a process can have a number of Thread.
2), when an Android program starts running, there is a main thread that is created. This thread is primarily responsible for the display, update, and control interaction of the UI interface, so it is also called the UI thread.
When an Android program was created, a process presented a single-threaded model-that is, the Main thread, and all the tasks were run in one thread. Therefore, each function called by the Main Thread should be as short as possible. For more time-consuming work, you should try to give the sub-thread to do so as to avoid blocking the main thread (the main thread is blocked, causing the program to feign animation).

3), Android single-threaded model: Android UI actions are not thread-safe and these actions must be performed in the UI thread. If you modify the UI directly in a child thread, the exception is caused.

7.Android DVM processes and Linux processes, whether the application process is the same concept
DVM refers to DALIVK virtual machines. Each Android application runs in its own process and has a separate instance of the Dalvik virtual machine. And each DVM is a process in Linux, so it can be thought of as the same concept.

What is the role of the EF file for 8.sim cards
SIM card file system has its own specifications, mainly in order to communicate with the mobile phone, SIM itself can have its own operating system, EF is for storage and communication with the mobile

What are the types of animations in 9.android, and what are their characteristics and differences?
Two kinds, one is Tween animation, and another is Frame animation. Tween animations that enable the view components to move, zoom in, zoom out, and create changes in transparency; Another Frame animation, the traditional animation method, through the sequence of playing the arranged picture to achieve, similar to the film.

    1. Let activity become a window: Activity property settings

Talk about something easy, maybe someone wants to make the app is a floating in the main interface of mobile phone things, then very simple you just need to set up the activity of the topic can be defined in the androidmanifest.xml where the activity in a word:

XML Code

    1. Android:theme= "@android: Style/theme.dialog"

This causes your application to pop up as a dialog box, or

XML Code

    1. Android:theme= "@android: Style/theme.translucent"

It becomes translucent, [friendly tip-.-] similar to the properties of this activity can be on Android. As seen in the Androidmanifestactivity method of the R.styleable class, the properties of all elements in Androidmanifest.xml can be referenced in this class of Android. R.styleable

It says the attribute name, what the value is on Android. As you can see in R.style, this "@android: Style/theme.dialog" corresponds to Android. R.style.theme_dialog, (' _ ' replaced with '. ' <-Note: This is the article content is not a smiley face) can be used in the description file, find the class definition and description of the corresponding relationship in the file is understood.

    1. How do I publish a SQLite database (dictionary.db file) with the apk file?
      Answer: You can copy the Dictionary.db file to the Res AW directory in Eclipse Android project. All files in the Res AW directory are not compressed so that the files in that directory can be extracted directly. The dictionary.db file can be copied to the Res AW directory

    2. How do I open a database file in the Res AW directory?

Answer: You cannot open a database file in the Res AW directory directly on Android, but you need to copy the file to a directory in your phone's memory or SD card when the program first starts, and then open the database file. The basic method of replication is to use the Getresources (). Openrawresource method to obtain the InputStream object for a resource in the Res AW directory, and then write the data in the InputStream object to the corresponding file in the other directory. The Sqlitedatabase.openorcreatedatabase method can be used in the Android SDK to open SQLite database files in any directory.

    1. The specific embodiment of MVC in Android

MVC is an acronym for Model,view,controller, and you can see that MVC contains three parts:
.. Model object: Is the main part of the application, and all business logic should be written in the
Layer.
.. View object: Is the part of the application that is responsible for generating the user interface. Also in the whole
The only layer the user can see in the MVC schema, receiving input from the user and displaying processing results.
.. Controller object: Control user interface data display and update according to user's input
Model object State Part, the controller is more important one kind of navigation function, wants to use the user to start the phase
Off the event, to M oh got processing.

Android encourages weak coupling and component reuse, and the specific embodiment of MVC in Android is as follows
1) View layer: The general use of XML file interface description, the use of the time can be very convenient to introduce, of course, how you learn more about Android, you can think of Android can also use javascript+html and other ways as The view layer, of course, requires a communication between Java and JavaScript, and fortunately, Android provides a very handy communication implementation between them.

2) control layer (Controller): The task of Android control layer usually falls on the shoulders of many acitvity, this phrase also implies do not write code in acitivity, want to through activity delivery model business Logic Layer processing, do this Another reason is that the response time of Acitivity in Android is 5s, and if time-consuming operations are put here, the program is easily recycled.

3) Model: the operation of the database, the operation of the network, etc. should be processed in the model, of course, business calculations and other operations must be placed in the layer.

Architecture of the 15.Android system
Android's system architecture, like its operating system, employs a layered architecture. From the architecture diagram, Android is divided into four tiers, from the high-level to the lower layer, which are application layer, application framework layer, system run-level and Linux core.
1. Application
Android is published with a range of core application packages, including email clients, SMS short message programs, calendars, maps, browsers, contact management programs, and more. All applications are written in the JAVA language.
2. Application Framework
Developers also have full access to the API framework used by the core application. The architectural design of the application simplifies the reuse of components; Any application can publish its block of functionality and any other application can use its published block of functionality (subject to the security restrictions of the framework). Similarly, the application reuse mechanism also makes it easy for users to replace program components.
Hidden behind each app is a series of services and systems, including;
* Rich and extensible view (views) that can be used to build applications, which include lists (lists), grids (grids), text boxes (texts boxes), buttons (buttons), and even web browsers that can be embedded.
* Content Providers allows applications to access data from another application, such as a contact database, or share their own data
* Resource Manager (Resource Manager) provides access to non-code resources such as local strings, graphics, and layout files.
* Notification Manager (Notification Manager) enables applications to display customized prompts in the status bar.
* Activity Manager is used to manage the application lifecycle and provide common navigation fallback functionality.
For more details and how to write an application from scratch, refer to how to write an Android app.
3. System Runtime Library
1) Program Library
Android contains a number of C + + libraries that can be used by different components of the Android system. They provide services to developers through the Android application framework. Here are some core libraries:
* System C Library – A standard C system function library (LIBC) that is inherited from BSD, which is specifically tailored for embedded Linux-based devices.
* Media Library – based on PacketVideo Opencore; The library supports a variety of commonly used audio, video format playback and recording, while supporting still image files. Encoding formats include MPEG4, H. MP3, AAC, AMR, JPG, PNG.
* Surface manager– Management of the display subsystem and provides seamless integration of 2D and 3D layers for multiple applications.
* libwebcore– an up-to-date web browser engine with support for Android browser and an embeddable Web view.
* sgl– Bottom 2D graphics engine
* 3D libraries– based on OpenGL ES 1.0 APIs; The library can use hardware 3D acceleration (if available) or use highly optimized 3D soft acceleration.
* freetype– Bitmap (bitmap) and vector (vectors) font display.

    • sqlite– a lightweight relational database engine that is available and powerful for all applications.
      2) Android Runtime
      Android includes a core library that provides most of the functionality of the JAVA programming language core Library.
      Each Android application runs in its own process and has a separate instance of the Dalvik virtual machine. Dalvik is designed as a device that can run multiple virtual systems at the same time and efficiently. Dalvik Virtual Machine Execution (. dex) Dalvik executable, which is optimized for small memory usage. While the virtual machine is a register-based, all classes are compiled by the Java compiler and then converted to. dex format by the "DX" tool in the SDK to be executed by the virtual machine.
      Dalvik virtual machines rely on some of the features of the Linux kernel, such as threading mechanisms and underlying memory management mechanisms.
      4.Linux kernel
      Android's core system services rely on the Linux 2.6 kernel, such as security, memory management, process management, network protocol stacks, and drive models. The Linux kernel also acts as an abstraction layer between the hardware and the software stack.

Information for 16.Android Common controls
Radio Box (RadioButton and Radiogroup):
The Radiogroup is used to group the radio boxes, and only one radio box is selected for the radio box in the same group.
Event: Setoncheckedchangelistener (), Handling Radio box selected event. The Radiogroup.oncheckedchangelistener instance is passed in as a parameter.
Multiple marquee (checkbox):
Each multi-box is independent, and can be obtained by iterating through all the multi-marquee boxes and then depending on whether the state is selected.
Event: Setoncheckchangelistener () handles multi-marquee selected events. Passing the Compoundbutton.oncheckedchangelistener instance as a parameter
Drop-down list box (Spring):
Spinner.getitematposition (Spinner.getselecteditemposition ()); Gets the value of the drop-down list box.
Event: Setonitemselectedlistener (), Handle drop-down list box is selected event to pass Adapterview.onitemselectedlistener instance as parameter;
Drag bar (SeekBar):
Seekbar.getprogress () Gets the current value of the drag bar
Event: Setonseekbarchangelistener (), handles the drag bar value change event, and passes the Seekbar.onseekbarchangelistener instance as a parameter.
Menu:
Override the Activity's Oncreatoptionmenu (Menu menu) method, which is used to create the Options menu, which displays the created menu when the user presses the "menu" button on the phone, in Oncreatoptionmenu (Menu menu) You can call the Menu.add () method inside the method to implement the menu additions.
Overrides the Activity's onmenuitemselected () method, which is used to handle menu-selected events.
Progress dialog box (ProgressDialog):
Create and display a progress dialog box: Progressdialog.show (progressdialogactivity.this, "Please Wait", "data is loading ....", true);
Style of the Settings dialog: Setprogressstyle ()
Progressdialog.style_spinner Rotation progress bar style (default style)
Progressdialog.style_horizontal Horizontal progress bar Style

  1. Please describe the five types of layouts commonly used in Android
    Android layout is an important part of the development of the application interface, in Android, there are five ways of layout, namely: Framelayout (frame layout), LinearLayout (linear layout),
    Absolutelayout (absolute layout), relativelayout (relative layout), tablelayout (table layout).
    1.FrameLayout
    This layout can be seen as a invade heap of things, there is a square of the upper left corner of the rectangle invade, we put the first thing, to put another, it is placed in the original position above, in order to put, will cover the original things. This layout is relatively simple, it can only put a little more simple things.
    2.LinearLayout
    Linear layout, this thing, from the outer frame can be understood as a Div, he first is a one from the top down listed on the screen. Each of the linearlayout can be divided into vertical layouts (android:orientation= "vertical") and horizontal layouts (android:orientation= "horizontal"). When vertical layout, there is only one element for each row, and multiple elements are descending vertically; when horizontal layout, there is only a row, and each element is arranged to the right.
    There is an important attribute in the LinearLayout android:layout_weight= "1″, which represents the line spacing when vertical layout, the width of the column, the larger the weight value.
    3.AbsoluteLayout
    The absolute layout is as if the div specifies the absolute property, the position of the element is specified with x, y coordinates android:layout_x= "20px" android:layout_y= "12px" This layout is also relatively simple, but when the vertical random switch, Often there are problems, and multiple elements of the time, the calculation is more troublesome.
    4.RelativeLayout
    The relative layout can be understood as the layout of an element as a reference object. The main attributes are:
    Relative to an element
    android:layout_below= "@id/aaa" the element under the ID AAA
    android:layout_toleftof= "@id/bbb" the left side of the element is BBB.
    Place relative to the parent element
    Android:layout_alignparentleft= "true" left-justified on parent element
    Android:layout_alignparentright= "true" right-aligned on parent element
    You can also specify margins and so on, as detailed in the API

5.TableLayout
The table layout is similar to the table in Html. Each tablelayout inside has the table row TableRow, TableRow inside can define each element concretely, sets his alignment android:gravity= "".
Each layout has its own appropriate way, and these five layout elements can be nested within each other to make an aesthetically pleasing interface.

    1. How to enable service, how to deactivate service
      Services in Android and services in Windows are similar, services generally do not have user interface, it runs in the system is not easy to be detected by the user, you can use it to develop such as monitoring programs. The development of the service is relatively simple, as follows:
      First step: Inheriting the Service class
      public class SMSService extends Service {
      }
      Step Two: Configure the service in the node in the Androidmanifest.xml file:

The service cannot run itself and needs to start the service by calling the Context.startservice () or Context.bindservice () method. Both of these methods can start the service, but they are used in different situations. The service is enabled with the StartService () method, the caller is not connected to the service, and the service is still running even if the caller exits. Using the Bindservice () method to enable the service, the caller and the service are bound together, and once the caller exits, the service terminates, and there is a "no need to live at the same time Must Die" feature.

If you plan to start the service with the Context.startservice () method, the system calls the service's OnCreate () method first, and then calls the OnStart () method when the service is not created. If the StartService () method is called before the service has been created, calling the StartService () method multiple times does not cause the service to be created more than once, but results in multiple calls to the OnStart () method. Services started with the StartService () method can only call the Context.stopservice () method to end the service, and the OnDestroy () method is called at the end of the service.

If you plan to start the service with the Context.bindservice () method, the system calls the service's OnCreate () method first, and then calls the Onbind () method when the service is not created. This time the caller and the service are bound together and the caller exits, the system calls the service's Onunbind () method first, and then calls the OnDestroy () method. If the service is already bound before the Bindservice () method is called, multiple calls to the Bindservice () method do not cause the service and bindings to be created multiple times (that is, the OnCreate () and Onbind () methods are not called multiple times). If the caller wants to unbind the service being bound, it can call the Unbindservice () method, and calling the method will also cause the system to invoke the service's Onunbind () –>ondestroy () method.
The service common life cycle callback method is as follows:
OnCreate () This method is called when the service is created, and the method is only called once, and the service is created only once, regardless of how many times the StartService () or Bindservice () method is called.
OnDestroy () This method is called when the service is terminated.

Life cycle methods related to starting services with the Context.startservice () method
OnStart () The method is only invoked when the service is started with the Context.startservice () method. This method is called when the service starts running. The StartService () method is called multiple times although the service is not created more than once, but the OnStart () method is called multiple times.

Life cycle methods related to starting services with the Context.bindservice () method
Onbind () The method is only invoked when the service is started with the Context.bindservice () method. This method is called when the caller and the service are bound, and the Context.bindservice () method is called multiple times when the caller is tied to the service and does not cause the method to be called more than once.
Onunbind () The method is only invoked when the service is started with the Context.bindservice () method. This method is called when the caller and the service are unbound

The code to start the service using the Context.startservice () method is as follows:
public class Helloactivity extends Activity {
@Override
public void OnCreate (Bundle savedinstancestate) {
......
Button button = (button) This.findviewbyid (R.id.button);
Button.setonclicklistener (New View.onclicklistener () {
public void OnClick (View v) {
Intent Intent = new Intent (helloactivity.this, Smsservice.class);
StartService (Intent);
}});
}
}

The

Use the Context. Bindservice () method to start the service code is as follows:
public class Helloactivity extends Activity {
Serviceconnection conn = n EW serviceconnection () {
public void onserviceconnected (componentname name, IBinder service) {
}
public void O nservicedisconnected (componentname name) {
}
};
@Override
public void onCreate (Bundle savedinstancestate) {
Button button = (Button) This.findviewbyid ( R.id.button);
Button.setonclicklistener (New View.onclicklistener () {
public void OnClick (View v) {
Intent Intent = new Inten T (Helloactivity.this, Smsservice.class);
Bindservice (Intent, Conn, context.bind_auto_create);
//unbindservice (conn);//Unbind
}});
}
}

19.ListView optimization
Working principle:
The ListView requires adapter "Give me a View" (GetView) for each item in the list.
A new view is returned and displayed
What if we have billions of items to show? Create a new view for each project? No! That's impossible!
Android actually caches the view for you.
There's a widget called recycler in Android, and that's how he works:
If you have 1 billion items (item), only the visible items exist in memory, others are in recycler.
1. The ListView first requests a type1 view (GetView) and then requests other visible items. Convertview is empty (null) in GetView.
2. When item1 rolls out of the screen and a new item comes up from the low end of the screen, the ListView requests a type1 view. Convertview is not a null value at this time, its value is item1. You just need to set up new data and return to Convertview, without having to recreate a view.

20 Broadcast receiver Life cycle
A broadcast receiver has a callback method: void OnReceive (Context curcontext, Intent broadcastmsg). When a broadcast message arrives at the receiver, Android calls its onreceive () method and passes it to the intent object that contains the message. The broadcast receiver is considered to be active only when it executes this method. When OnReceive () returns, it is inactive.
The process of having an active broadcast receiver is protected and will not be killed. However, the system can kill only inactive components at any time when the process is needed by other processes that occupy the memory.
This poses a problem when the response of a broadcast message is time-consuming, so it should be done in a separate thread, away from the main thread that the other components of the user interface are running. If the onreceive () derived thread then returns, the entire process, including the new thread, is judged inactive (unless the other application component in the process is active), it will put it in a crisis of being killed. The way to solve this problem is to OnReceive () Start a service and do the work in a timely manner, so the system knows that there is active work in progress.

    1. design mode and IoC (control inversion)
      The source of the Android Framework's appeal is the IOC, which in the process of developing Android you will always feel the IOC brings
      Great convenience, take the Activity, the following function is called automatically by the framework call:
      protected void OnCreate (Bundle savedinstancestate);
      Instead of being called by the program writer, the user-written code is called by the framework, which reverses
      The Of course, the IOC itself is much more than that, but in this case you can also peep out the IOC
      Bring great benefits. Examples of this class are ubiquitous in Android, such as the management class for databases,
      For example, the Handler call of SAX in Android. Sometimes, you even need to write your own Jane
      Single IoC implementation, the multithreading shown above is now a description.

Length unit in 22.Android detailed
Now let's introduce the DP and SP. DP is also dip. This is basically similar to SP. You can use a DP or SP if you set properties that represent length, height, and so on. However, if you set the font, you need to use the SP. The DP is not density-independent, and the SP is not related to scale, except for density. If the screen density is 160, then the DP and SP and PX are the same. 1DP=1SP=1PX, but if you use PX as the unit, if the screen size is constant (assuming 3.2 inches), the screen density becomes 320. So the original width of the TextView is set to 160px, in the density of 320 of the 3.2-inch screen is more than the density of 160 of the 3.2-inch screen to see the half-short. But if it is set to 160DP or 160SP. The Width property value is automatically set to 320px. That means 160 * 320/160. Where 320/160 can be called a secret
Degree scale factor. That is, if you use the DP and SP, the system will automatically change depending on the screen density
To convert.

Let's see what other units mean.
PX: Indicates the actual pixel of the screen. For example, 320*480 's screen has 320 pixels in the landscape,
There are 480 pixels in the portrait.

In: represents inches, which is the physical size of the screen. Equal to 2.54 centimeters per inch. For example, describe
Mobile screen size, often said, 3.2 (English), 3.5 (English), 4 (English) inch means this
Unit. These dimensions are the diagonal length of the screen. If the phone's screen is 3.2 inches, it means the phone
The diagonal length of the screen (viewable area) is 3.2*2.54 = 8.128 cm. Readers can go to volume
A volume of their own mobile phone screen, see and the actual size is consistent.

    1. 4 types of activity start-up modes
      Standard: Normal mode, a call to the StartActivity () method produces a new instance.
      Singletop: If an instance already exists at the top of the activity stack, it does not produce a new instance, but simply invokes the newinstance () method in activity. If it is not at the top of the stack, a new instance is generated.
      Singletask: this instance will be generated in a new task, which will be used for each subsequent invocation and will not produce a new instance.
      SingleInstance: This is basically the same as Singletask, there is only one difference: In this mode the activity instance is in the task, only the activity instance, cannot have other instances.

    2. What is ANR how to avoid it?
      Anr:application Not Responding, five sec
      In Android, the two system services, Activity Manager and window manager, are responsible for monitoring the response of the application. Android Displays the ANR dialog box when the following conditions occur:
      More than 5 seconds of response to input events such as keystrokes, touch-screen events
      Intent Receiver (Intentreceiver) has not been executed for more than 10 seconds
      The Android application runs completely in a separate line approached (for example, main). This means that any operation that runs in the main thread and consumes a lot of time will cause the ANR. Because at this point, your application has no chance to respond to input events and intent broadcasts (Intent broadcast).

Therefore, any method running in the main thread should do as little work as possible. In particular, important methods in the life cycle of the activity, such as onCreate () and Onresume (), should be more so. Potentially more time-consuming operations, such as access to networks and databases; Or a very expensive calculation, such as changing the size of a bitmap, that needs to be done in a separate sub-thread (or with an asynchronous request, such as a database operation). But this does not mean that your main thread needs to go into a blocking state that has waited for the child thread to end-nor does it need to call the therad.wait () or Thread.Sleep () method. Instead, the main thread provides a handle (Handler) for the child thread, allowing the child thread to call it at the end of the process (Xing: See the example of Snake, which differs from what we were in contact with previously). Using this approach involves your application, which ensures that your program responds well to the input and avoids the ANR resulting from an input event that is not processed for more than 5 seconds. This practice needs to be applied to all threads that display the user interface, because they all face the same timeout problem.

Use of 25.Android Intent
In an Android application, it is mainly composed of some components (activity,service,contentprovider,etc.) In the communication between these components, the Intent assists the completion.
As some people on the internet said, Intent is responsible for the operation of the application in the action, the action involved in data, additional data description, Android according to the description of this Intent, is responsible for finding the corresponding component, the Intent passed to the calling component, and complete the call of the component. Intent is where the decoupling between the caller and the callee is implemented.
In Intent delivery process, to find the target consumer (another activity,intentreceiver or Service), that is, the Intent responder, there are two ways to match:
1, display match (EXPLICIT):
Public TESTB Extents Activity
{
.........
};
public class Test extends Activity
{
......
public void switchactivity ()
{
Intent i = new Intent (test.this, Testb.class);
This.startactivity (i);
}
}
The code is straightforward, and the switchactivity () function is executed, and immediately jumps to the Activity named Testb.

2, implicit matching (implicit):

Implicit matching, first to match several values of Intent: Action, Category, data/type,component
If you fill in the componet is the Test.class in the example above) this forms a display match. So this section only tells the first few matches. The matching rule is the maximum matching rule,

1, if you fill in the action, if there is a program in the manifest.xml of an Activity in the Intentfilter segment defined contains the same action then this Intent will match this target Action, if the The type,category is not defined in the Filter section, then the Activity is matched. But if you have more than two programs in your phone, a dialog box will pop up to show you the message.
The value of Action has a lot of pre-defined in Android, and if you want to go directly to your own defined Intent receiver, you can add a custom Action value to the recipient's Intentfilter (and set the Category value to "android.i Ntent.category.DEFAULT "), set the Action in your Intent to Intent, and you can jump directly to your own Intent receiver. Because this Action is unique in the system.
2,data/type, you can use URIs as data, such as URI uri = Uri.parse (http://www.google.com);
Intent i = new Intent (Intent.action_view,uri); The Intent distribution process of the mobile phone will determine the data type according to the scheme of http://www.google.com
The brower of the handset can match it, in the intenfilter of Brower Manifest.xml first have Action_view ACTION, also can handle http: the type,

3, as for classification category, generally do not go to set it in Intent, if you write Intent receiver, in Manifest.xml Activity Intentfilter contains Android.category.DEFAUL T, so that all do not set Category (Intent.addcategory (String c); ) will match this Category with the Intent.

4,extras (additional information), is a collection of all other additional information. You can use extras to provide extended information for your component, such as, if you want to perform the "Send e-mail" action, you can save the e-mail message's title, body, and so on in extras, to the e-mail sending component.

Android Common face question

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.