In Android development, the biggest headache is multi-screen adaptation of images. Of course, we can add an image for each screen, but that will increase the size of the app.
Especially if both portrait and landscape screens are supported, they
Backup:
Public void showsystemdialog (string showinfo, final int flag) {alertdialog. builder B = new alertdialog. builder (context); B. setmessage (showinfo); B. setpositivebutton ("OK", new dialoginterface. onclicklistener () {public void
JAVA Program section:
Setcontentview (R. layout. index); tabhost = (tabhost) findviewbyid (R. id. tabhost); // If tabactivity is not inherited, use this method to load and start tabhost. setup ();/* tabhost. addtab (tabhost. newtabspec ("tab1 ").
1. compile a class that inherits application public class appclose extends application {private list mainactivity = new arraylist (); public list mainactivity () {return mainactivity ;} public void addactivity (Activity Act) {mainactivity. add
Bytes ~
Android. Support. v4.viewpager class in API
The 4 + support package is initially provided for us. It enables us to slide left and right to display data in the form of a 'page. We can inherit
PagerAdapterTo generate a page view. Let's take a
Today, when I read some source code, I found that people do not need to set the title layout file. After reading it, it is quite convenient,
The procedure is as
Because the space of the seekbar and ratingbar controls is relatively simple, code is directly pasted here.
Use of seekbar:
Content of the Main. xml file:
Android: Orientation = "vertical"Android: layout_width = "fill_parent"Android: layout_height =
Before using tabhost, let's take a simple look at its source code.
Main variables include:
Private tabwidget mtabwidget;
Private framelayout mtabcontent;
Private list mtabspecs = new arraylist (2 );
That is to say, our tabhost must have these three
This is a serious problem that I recently encountered and cannot be solved perfectly. In desperation, I posted a question to the csdn Android version. I did not expect to disturb the moderator and gave me a lot of help, so that I can solve similar
You must know: 1. Know that R. Java under gen is do not modify. (unchangeable !)
2. For each control in Main. XML, if an ID address is added to the control, the unique ID will be added to R. java.
3. added the control to main. xml. to display the
1: from a -- activity to B -- Activity
Intent intent = new Intent();intent.setClass(BundleDemoActivity.this, otherActivity.class);
2: transfer data from a -- activity to B -- Activity
Intent intent = new
Layout file:
Set a listview in Main. xml and set the layout of each individual item in listview in other. XML in detail. For example:
In Main. xml:
In other. xml:
Code in activity:
list = (ListView) findViewById(R.id.listView);Cursor
The textview attributes are collected online, which is useful in the development process.Android: autolinkSet whether to display clickable links when the text is URL link, email, phone number, or map. Optional values
public static Bitmap createReflectedImage(Bitmap originalImage) { final int reflectionGap = 4; int width = originalImage.getWidth(); int height = originalImage.getHeight(); Matrix matrix = new Matrix(); matrix.preScale(1, -1);
The previous article introduced the implementation of custom listview with checkbox. This article describes the implementation of custom expandablelistview with checkbox. The principle is the same as that of listview, you only need to modify the
To check what is happening in the running application, you need to check the running Dalvik VM. In eclipse, choose Window> open perspective> Other. Select ddms in the displayed dialog box. This will open a new perspective in eclipse, which has many
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