This method transmits the long integer of the current time to the Random object so that the generated value changes over time.
Www.2cto.comStrings = "";Random ran = new Random (System. currentTimeMillis ());For (inti = 0; I S = s + "\ n" + ran.
In android, the interface can be designed in advance in the. xml file, or dynamically generated in the java code. Package snoopy. android; Import android. app. Activity;Import android. OS. Bundle;Import android. view. View;Import android. view. View.
LinearLayout is the simplest and most frequently used Android layout. Through simple linear layout, we can design some good interfaces. However, my design skills are average, so I can only demonstrate one failed example for you to use as a negative
When you use the android interface development tool droiddraw, you will find that its default layout is absolute layout, that is, using coordinates to specify the location of each control, this method is more convenient when you drag controls
Radiobutton is the single-choice button, and checkbox is the check button, that is, multiple options can be selected at the same time. The following program defines a set of radio buttons and three check boxes to allow users to select user-related
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
Previous: http://www.bkjia.com/kf/201201/115826.html
In Android, AutoCompleteTextView can automatically complete text input boxes, which is similar to Ajax in Web pages. When using this function, you must specify an adapter to set the complete text.
Handle system configuration changesMany 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 (),
A Fragment represents some behaviors in the Activity or some user interfaces. You can combine multiple Fragment in an Activity to create multiple UI panels. You can also reuse one Fragment in multiple activities. You can understand Fragment as a
Custom ComponentsThe Android system provides a powerful component model for users to create their own UIS. This model is based on basic layout classes such as View and ViewGroup. The Android system contains the pre-created child classes of View and
Supplement: the android platform calls the post method for file transmission:
Public void onCreate (Bundle savedInstanceState ){Super. onCreate (savedInstanceState );SetContentView (R. layout. main );New Thread (new Runnable (){Public void run
When reading image files in sdcard, see the following functions to read image files in a stream:
[Java] public static void ShowImg (String uri, ImageView iv) throws IOException {FileInputStream fs = new FileInputStream (uri );BufferedInputStream bs =
1. The interface method is used for callback (the interface is defined here to use its interface method ): 01Public interface ICallback {02Public void func ();03}0405Public class Caller {06ICallback callback;07Public void doCallback (){08Callback.
At least the size of memory allocated by the Android app on T-Mobile G1 on the stack is limited to 16 Mb. For mobile phones, this is not a small memory, but it is still far from meeting the needs of some developers. However, even if you do not plan
The main idea is how to design a TableLayout + TableRow In the UI Designer. in practical applications, you often need to add data to TableLayout in the Code (TableLayout can also be used for 9 gongtu ), this article describes how to use Android:
Android: layout_above: Move the control's bottom to the control with the given IDAndroid: layout_below: place the top of the control under the control with the given IDAndroid: layout_toLeftOf align the right edge of the control with the left edge
RadioButton (single-choice button) is widely used in Androi development. For example, when selecting items, single-choice buttons are used. It is a button in the single and single States of a single circular circle, which can be selected or not.
IntroductionA calendar Layout View with year, month, and day selected class inheritanceJava. lang. ObjectAndroid. view. ViewAndroid. view. ViewGroupAndroid. widget. FrameLayoutAndroid. widget. DatePicker MethodPublic int getDayOfMonth ()Obtain the
The spinner is equivalent to the drop-down list box in Html. In the following example, we will learn how to use the spinner.
Attribute:
Attribute name
Description
Android: prompt
This prompt is displayed in the drop-down
When the Activity of your Android app needs to use the Custom drawable background, using the Custom Theme can save the display loading speed of the UI. Before explaining the cause, you need to clarify the concept: Window background. Many people
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