Android development collection

Source: Internet
Author: User

1. Adaptive Image configuration of various sizes: http://blog.csdn.net/luoyuhhy/article/details/6451901

Search Keyword: Android Image Adaptive resolution

2. Dialog: http://www.cnblogs.com/salam/archive/2010/11/15/1877512.html

3, photo album, camera image processing: http://my.oschina.net/onlytwo/blog/71192

4. [Android instance] listview nested gridview (gridview achieves horizontal sliding)

Address: http://download.csdn.net/detail/wyyl1/5121975

5. Transfer objects

List is a serializable object.

Pass value:

Intent mintent = new intent (mcontext, chexiactivity. Class );
Carbrand cb = GCB. getfllist (). Get (position );
Bundle mbundle = new bundle ();
Mbundle. putserializable ("carbrandlist", list );
Mintent. putextras (mbundle );

Mcontext. startactivity (mintent );

Valid value:

List = (arraylist <carbrands>) getintent (). getserializableextra ("carbrandlist ");

6. Android. Support. v4.view. pageradapter obtains the current page.

Pageradapter get current page

Mviewpager. getcurrentitem ()

Address: http://stackoverflow.com/questions/8538035/android-pageradapter-get-current-position

7. Exit the app code from Android

Android. OS. process. killprocess (Android. OS. process. mypid ());

Code with the dialog box:

New alertdialog. Builder (this). settitle ("exit"). setmessage ("OK? ")
. Setpositivebutton ("yes", new onclicklistener (){
@ Override
Public void onclick (dialoginterface dialog, int which ){
Android. OS. process. killprocess (Android. OS. process. mypid ());
}
}). Setnegativebutton ("no", null). Show ();

8. android-support-v4.jar source code Association

Remove Android Dependencies
Right-click the libs android-support-v4.jar build path-> Add to build path
Re-select the Android version to regenerate Android Dependencies

Address: http://www.cnblogs.com/hanleytowne/archive/2013/01/24/android-support-v4.html

9. Disable activity sleep. Disable sleep in Android.

Getwindow (). setflags (windowmanager. layoutparams. flag_keep_screen_on, windowmanager. layoutparams. flag_keep_screen_on );

Address: http://abc20899.iteye.com/blog/1045537

Related Article

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.