Android gets the height of the status bar and title bar.

// Obtain the screen width displaymetrics = getresources (). getdisplaymetrics (); screenwidth = displaymetrics. widthpixels; // obtain the height rect = new rect (); window = getwindow (); mimageview of the title bar and status bar.

Two ways for Android to remove built-in animations

Method 1:Call after startactivity () or finish:(Activity) mcontext). overridependingtransition (0, 0 ); Method 2:In some special cases, method 1 cannot be implemented.For example, you have set properties for intent:Intent. addflags (intent.

Android asynchronous image loading method 1 (4)

Main. XML is as follows: Listviewitem. XML is as follows:  

Android fragmentation knowledge point

1 viewstub usageReferences:Here are a series of practical skills.Http://blog.csdn.net/hitlion2008/article/details/6737537Chinese API:Http://www.iteedu.com/handset/android/androidcnapi5/42.php   2. Use the system color: Android: textcolor = "@

Android determines whether the current application is running on the foreground

mainactivity: Package CN. testforeground; import Java. util. list; import android. OS. bundle; import android. app. activity; import android. app. activitymanager; import android. app. activitymanager. runningtaskinfo; import android. content.

Android service full resolution (1)-startservice

mainactivity: Package CN. testservice1; import android. OS. bundle; import android. view. view; import android. view. view. onclicklistener; import android. widget. button; import android. app. activity; import android. content. intent;/*** demo

Android Touch event Transfer Mechanism

Mainactivity is as follows: Package cn. c; import android. OS. bundle; import android. app. activity; import android. view. menu; // The first test // The output result is as follows: // call onInterceptTouchEvent () in MyFrameLayout //

Common Bitmap operations in Android (II. Code)

Package com. testbitmapscale; import java. io. file; import java. io. fileInputStream; import java. io. fileOutputStream; import java. io. IOException; import java. io. inputStream; import java. util. iterator; import com. testbitmapscale. r.

Handler common methods in Android

Package com. example. testhandler; import android. OS. bundle; import android. OS. handler; import android. OS. message; import android. app. activity; // Handler common methods: // 1 post () // 2 postDelayed () // 3 sendMessage () // 4

[Android sharing] reducing the power consumption of android apps

First, let's take a look at the main usage of android phones:Obviously, most of the electricity is consumed by network connections, GPS, and sensors. In short, it consumes a lot of power in the following situations:1. Transmission of large data

Android video recording (5)

MainActivity is as follows: Package c. c; import android.net. uri; import android. OS. bundle; import android. provider. mediaStore; import android. view. view; import android. view. view. onClickListener; import android. widget. button; import

Android Drag Control to change its location

MainActivity is as follows: Package CN. dragtest; import android. app. activity; import android. graphics. rect; import android. OS. bundle; import android. util. displaymetrics; import android. view. motionevent; import android. view. view; import

Common Bitmap operations in Android (1. theory)

// Use BitmapFactory to generate Bitmap// Note that this method only generates Bitmap, so the returned value is a Bitmap.// Operations on Bitmap objects are not involved, such as rotating and compressing Bitmap objects.// The following are four

Android uses broadcast listening to press the HOME and RECENT_APPS keys

MainActivity is as follows: Package cn. testhomekey; import android. OS. bundle; import android. app. activity; import android. content. intent; import android. content. intentFilter;/*** Demo Description: * The HOME and RECENT_APPS keys of the

Android custom progressdialog

MainActivity is as follows: Package CN. testprogressdialog; import android. app. activity; import android. app. dialog; import android. content. context; import android. content. dialoginterface; import android. content. dialoginterface.

Android listening scrollview slides to the top and bottom

MainActivity is as follows: Package CN. testscrollview; import android. OS. bundle; import android. view. motionevent; import android. view. view; import android. view. view. ontouchlistener; import android. widget. scrollview; import android. app.

Android uses the TTF file to set the font

MainActivity is as follows: Package cn. testfont; import android. OS. bundle; import android. widget. textView; import android. app. activity; import android. graphics. typeface;/*** Demo Description: * use the TTF font file text display effect **

Android Iphone-like notification badge Implementation (2)

MainActivity is as follows: Package cc. testtipmessage1; import android. OS. bundle; import android. widget. imageView; import android. app. activity; import android. graphics. bitmap; import android. graphics. canvas; import android. graphics.

Android Service (Service) full resolution (IV)-AIDL

The following are the clients: Mainactivity is as follows: Package cn.com. remoteServiceClient; import com.cn. aidl. IRemoteQuery; import android. app. activity; import android. content. componentName; import android. content. intent; import android.

Shadow Effect of Android text

Total Pages: 2774 1 .... 2348 2349 2350 2351 2352 .... 2774 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.