Create submenus A sub-menu is a menu opened on an existing menu. You can add sub-menus to any menu.ProgramSub-menus are the best choice if they have many functions and can be organized by category, such as the menu bar (file, edit, view, and so on)
The android source code directory hardware/RIL/libril contains a total of five C/CPP files: ril_commands.h, ril_unsol_commands.h, ril_event.h, ril_event.cpp, and rIL. cpp. This article mainly analyzes the RIL. cpp file. We can divide the file into
This article introduces how to implement the four string output functions and corresponding enumeration types in some codes in RIL. cpp. First, let's take a look at Code. Its function is to convert the commands in ril_command.h and
In the following example, we will experiment with all the content mentioned above. In this example, an activity contains two fragment items. One shows the playing tracks of Shakespeare's plays, and the other shows the abstract of the selected tracks.
I learned Android hard from the summer vacation and recorded my learning experience on my blog at that time. I encountered many difficulties along the way, but I also learned a lot. I am a curious person. I often look at the latest developments and
When an application component starts running and no other components are running, the system starts a new Linux Process for the application, which has only one thread. by default, all components of an application run in one process and thread (main
To manage fragment, you need to use fragmentmanager. To obtain it, you need to call the getfragmentmanager () method in the activity (). You can use fragmentmanager to do the above: 1. Use findfragmentbyid () or findfragmentbytag () to obtain the
Mobile phone device vibration is a good way to feedback information to users, especially in game applications. To control device vibration, our application needs to be licensed, that is, add the following code to the androidmanifest. xml
Document directory Save activity status Save activity status In the "acitume lifecycle" section, it is mentioned that when pause and stop are performed, the activity status is kept in the memory. When resume is executed, it starts execution
Thread When an application is started, the system creates an execution thread called "Main ". This thread is very important because it is in charge of dispatching events to user interface controls. This includes drawing events. It is also your
Create a context menu A context menu is similar to a context menu on a PC. you should use the context menu to provide the action selection function for a part of the user interface. in Android, a context menu appears when you press an interface
Fragment is a part of the activity interface or an action. You can combine multiple fragment members into an activity to create a multi-faceted interface, and you can reuse one fragment in multiple activities. You can think of fragment as a
(1) connectivitymanager In Android, The connectivitymanager class represents the network connection service, which is used to monitor the network connection status, configure invalid reconnection, and control the network antenna. To obtain a
Here are some other features that you can apply to most menu entries.Menu Group A menu group is composed of a series of menu items that share certain features. For a group, you can: Display or hide all menu items. UsagesetGroupVisible() How to
Create Fragment To create a fragment, you must derive a class from the derived class of fragment or fragment. Fragment code is written like activity. It has the same callback method as activity, such as oncreate (), onstart (), onpause () and onstop
Menus are an important part of activity. It provides a great way for user operations. Android provides a simple framework to add standard menus to programs. There are three types of menus: Option menu The main set of menu items of an activity.
In the Android system, the path for storing Different ringtones is as follows: /System/Media/Audio/ringtones ringtone/system/Media/Audio/notifications SMS notification ringtone/system/Media/Audio/alarms alert ringtone Ringtone settings: Import Java.
Handle system configuration changes Many devices can change system configurations during operation, such as screen orientation, keyboard layout, and language. When similar changes occur, the system will restart the running activity (call ondestroy ()
Create an option menu The option menu should contain basic activity actions and required navigation entries (for example, a menu item set to open the program ). option menu items have two different options: one is the menu item button, and the other
Asynctask allows you to execute asynchronous work on your interface. It executes time-consuming operations in a work thread and sends the results to the interface thread. You do not need to manage the thread and handle yourself. To use it, you must