[2012-10-20 14:19:08-demo] --------------------------------[14:19:08-demo] Android launch![2012-10-20 14:19:08-demo] the connection to ADB is down, and a severe error has occured.[14:19:08-demo] You must restart ADB and eclipse.[14:19:08-demo]
There are three main ways to tile images for Android: 1) system API; 2) xml configuration; 3) custom Rendering
Method 1:System API implementation
Bitmap bitmap = bitmapfactory. decoderesource (getresources (), R. drawable. PIC); // bitmap =
1. Improve UI performance 1. Improve the efficiency of adapter and adapterview
Reuse the generated item View
Add viewholder to avoid repeated searches for controls to be modified
Cache item data
Segmented reality
Instance:
class OptAdapter extends
// Create an anonymous implementation of OnClickListenerprivate OnClickListener mCorkyListener = new OnClickListener() { public void onClick(View v) { // do something when the button is clicked }};protected void onCreate(Bundle
I. Use handler and message to update the page
Private handler mhandler = new handler (){
Public void handlemessage (Message MSG ){Switch (msg. What ){Case 1: // Add functionsInt I = integer. parseint (textview. gettext () + "");If (I> = 0 & I ++
I. Use timer and timertask
Timer timer = new timer ();
Mytimertask timertask = new mytimertask ();
Timer. Schedule (timertask, 3000, 1); // wait for 3 seconds and run once
// Timer. Cancel (); // cancel
Class mytimertask extends timertask {
@
Sometimes there are many small modules under a large project. If there is no connection between small modules, you can use each small module as a separate project to generate an APK.
In this case, how to put multiple APK files in a project is
For example, one thing I want to do is to connect a main interface (main activity) to many different sub-function modules (child activity ), after the sub-module is finished, it will return to the main interface. It may also return some data
In Android development, we often need to classify and operate data. For lightweight data storage, we may not need to use SQLite or XML with imperfect efficiency and class libraries, because sharedpreferences does not have the data enumeration method,
Android mobile phones use the "menu" button to display menus.
To implement the menu function, you must first create a menu by using oncreateoptionmenu. There are two ways to create a menu: one is to directly import an XML file with a menu, one is to
From: http://androidbiancheng.blogspot.com/2011/05/drawingcache.html
When you click the button, the application captures the screen effect display through the drawing cache and displays it in the imageview. The effect is as follows:
Main
Li huaming himiOriginal, reprinted must be explicitly noted:Reprinted from[Heimi gamedev block]Link: http://www.himigame.com/android-game/315.html
Many kids shoes say that after my code is run, clicking home or back will cause a program
During this time, I read some documents and summarized some methods for implementing the dialog box. In general, there are two principles: one is to use the dialog class, the second is to apply the dialog topic to the activity to achieve the dialog
Sometimes this happens when Google code downloads the source code and learns.
One project contains another project. It is equivalent to a reference of a jar package. But it is not a jar package, but a package.
I found this method on the
The first two articles briefly describe the method for parsing XML by using Sax to implement the parsing function. The following uses Sax to create an XML file.
The specific method of using Sax to create XML is to add relevant comments to the
When writing the parsing code, I found that I did not have a solid grasp of this aspect.
The problem is that, in an element, " ", the data in it is always not available. After testing, we found that,
PublicVoidCharacters (Char[]
Recently, when the android listview loads data in the Multi-choice mode, the data obtained by the getcheckitemids () method of listview is inaccurate. When you select one of the items, then, when you cancel the listitem, getcheckitemids () can still
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