object's main UI widget, a Spinner mSpinner = (Spinner)mActivity.findViewById(com.android.example.spinner.R.id.Spinner01); // Set the Spinner to a known position mActivity.setSpinnerPosition(TEST_STATE_DESTROY_POSITION); // Stop the activity - The onDestroy() method should save the state of the Spinner
the UI operation method of the tested application. Other test classes are not allowed. To execute a complete test method in the UI thread, you can add annotations to the thread.@UIThreadTestNote that all the statements of this method will be executed in the UI thread. methods that do not interact with the UI are not allowed. For example, you cannot callInstrumentation.waitForIdleSync().
To execute part of the test method in the UI thread, you can create a runnable Anonymous class, put the state
instrumentation. waitforidlesync ().If you want some code in the method to run in the UI thread, create an anonymous runnable object, put the code in the run () method, and then pass the object to the appactivity. runonuithread (). Here, appactivity is the app object you want to test.For example, the following code instantiates an activity to be tested, serves as the request focus of the spinner, and then sends a key to it. Note: waitforidlesync and
object ' s main UI widget, a Spinner Mspinner =(Spinner) Mactivity.findviewbyid (COM.ANDROID.EXAMPLE.SPINNER.R.ID.SPINNER01);//Set the Spinner to a known position Mactivity.setspinnerposition (test_state_destroy_position); // Stop the activity-the OnDestroy () method should save The state of the Spinner Mactivity.fini
elements:Pull refresh: ion-refresher use instruction Ion-refresher to increase the ability to pull the refresh/pull-to-refresh for a scrolling container (Ion-scroll or ion-content):The
On-refresh-executes this expression when the user pulls down enough distance and releases
On-pulling-executes this expression when the user starts to pull down
Pulling-text-Displays this text when the user pulls down
Pulling-icon-Displays this icon when the user pulls down
Refreshing-ico
Sometimes we need to load multiple menu files in an activity. For example, to achieve the following results:
1. We have a drop-down list. When we select the first drop-down item and press the menu key, the first menu is displayed;
2. Select the second drop-down item and press the menu key to bring up the second menu.
How can we achieve this effect?
Select the first entry for the spinner. The menu1 menu is displayed.
Select menu2 for the
The list selection box (Spinner) provided by Android is equivalent to the selection dropdown box for web-side user registration, such as registering for a selected province city. If it is a list selection boxThe list selection for the drop-down list can be specified by the Android:entries property of the XML file, or imported in Java code, and the attribute android:prompt is the title of the list item.A list item data: in practice, the data of many dr
I use Excel to manage a wide variety of forms, which are basically composed of the name of the unit plus the year, month, and table name. When you print these tables every once in a while, you make changes to parts of all the table headers, such as the unit name, year, or month, which are cumbersome and error-prone.
If you can do a dynamic header, all the headings need to change the part of the cell to make a reference, as long as the change in one place, all the headings will be changed togeth
I use Excel to manage a wide variety of forms, which are basically composed of the name of the unit plus the year, month, and table name. When you print these tables every once in a while, you make changes to parts of all the table headers, such as the unit name, year, or month, which are cumbersome and error-prone.
If you can do a dynamic header, all the headings need to change the part of the cell to make a reference, as long as the change in one place, all the headings will be changed togeth
use, but remember in this function must return a value, otherwise there is no effect.
The Updateborder function is called after the Applyborder function have had a chance to transform the value, and is usually Used to modify the DOM, send AJAX requests or perform any other kind of processing. In our case we ' re just getting the view ' s element and updating the border style using SetStyle. This means, every time setborder is called our DOM would immediately be updated to reflect the new style.
Gallery and Spinner have a common parent class: Abspinner, which shows that gallery and spinner are both a list box. The difference between them is that spinner displays a vertical list selection box, and gallery displays a horizontal list selection box. The role of spinner is for the user to choose, while Gallery allo
How do I use a progress indicator?
// Implementviewdidload to do additional setup after loading the view, typically from anib.
-(Void) viewdidload {
// Load the spinner hereNote that the webview setdelegate: SelfStatement. Only the following four web views can be processed.Heavy Load Process
Spinner = [[uiactivityindicatorview alloc] initwithframe: cgrectmake (0, 0, 50, 50)];
[Spinnersetcenter: cgpointmake
A single menu is used as a menu, similar to the select tag in HTML. A dialog box is displayed, showing several options for selection. The screen size of the mobile phone is limited. If you use the radiogroup single-choice button, it will occupy a lot of space. The final results of today's example are as follows:
The spinner needs to bind an adapter arrayadapter and place the menu items in the adapter,To add or delete a menu item, you only need to cal
, when an Activity is activated by Intent, its onCreate () method is called, followed by onResume (), when you start another application, the onPause () method is called. If the Activity calls the finish () method, its onDestroy () method is also called. The android framework API does not provide methods for you to directly call these callback methods in code, but you can use instrumentation.The system runs all the components in the application in the same process. You can run some components, s
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.