will explore the custom appcliation. As simple as creating a custom application class, there is a system for creating the Application object. Below we add a counter to the custom application.Import android.app.Application;public class CustomApplication extends application{private int counter = 0;public int Getcounter () {return ++counter;}}All components of the app can be application objects, and are the only one. As seen from the running results, there are several ways to get this object.custo
is Chinese oh, it is the pride of the People ~
Instructions for use see: https://www.zhihu.com/question/22678622
No.2 nebo--handwritten notes with formula
the biggest bright spot --the alteration is deleted, the box is highlighted, double-click Convertible, perfect support handwriting formula (after all, and MyScript Culculator family), and support in LaTeX or picture in the form of formula calculation of the export;
powerful query capabiliti
Invoke Action (as if it should be invoked, sorry). Add a description of Intent-fliter in Androidmanifest.xml, see: Pro Android Learning Note (11): Learn about Intent (medium).action Android:name= "Android.intent.action.VIEW" />category Android:name= "Android.intent.category.ALTERNATIVE"/>Alternative Menu CodeLet's see how to add the alternate menu to the Optionmenu. Alternative menu can also be loaded in S
has more than 50 packages and thousands of classes.In addition to andriod.*, including java.*,javax.*, as well as others, such as Org.apache.http,org.json, Org.w3c.com,org.xml.sax, Org.xml.sax.ext, Org.xml.sax.helpers, Org.xmlpull.v1, and ORG.XMLPULL.V1.SAX2 start with the namespace package.Benefit from Android Open source codeAndroid source code tutorial in http://source.android.com. Git is in https://android.googlesource.com/, but currently does not support online reading and must git down. O
You can add spinner down menu in action Bar, for spinner, refer to Pro Android Learning Note (20): User interface and Control (8): GridView and Spinner. The style of the list is related to theme, and an exception can occur if the theme settings are incorrect.The relevant code is as follows:public class Listactionbardemo extends SEARCHTESTCASE3implements Onnavigationlistener{//list triggered callback functio
downloaded picture, the relevant code is as follows:try{parcelfiledescriptor PFD = Manager.opendownloadedfile (Donedownloadid);FileDescriptor filedescriptor = Pfd.getfiledescriptor ();Bitmap Bitmap = Bitmapfactory.decodefiledescriptor (FileDescriptor);Pfd.close ();ImageView image = (ImageView) Findviewbyid (r.id.download_image);Image.setimagebitmap (bitmap);}catch (Exception e) {E.printstacktrace ();}View download status and cancel downloadsAdd a Cancel button in layout to trigger the Canceldow
Directory (?) [-]
Set different typography styles for horizontal and vertical rows
Rewrite code
For fragment, it often involves different screen sizes and different typography styles. We make a change in the basic small example, in the horizontal, is still realistic about two fragment, in the vertical row, as shown:Only one fragment is displayed on the screen, click on the number on the list to enter the activity of the introduction. Here's how it's implemented.Set different ty
Directory (?) [-]
Design the layout of the adapter
Code section
Activity's Code
Code data sources and constructors for Myadapter
The Myadapter code implements the custom adapter
Myadapter's code continues to explore Baseadapter
We can inherit the abstract class Baseadapter to implement their own adapter, set the child view of the UI, different sub-view can be different layouts, and their own data and sub-view of the corresponding relationship betwe
project to serve as a client. The client also needs to understand the interface and understand the definition of the parcelable person involved in the interface, So we need to copy the Istockquoteservice2.aidl,person.aidl and Person.java from the service.And the previous client just connect the interface, the parameters of the calling method are different, the relevant code is as follows:public class Mainactivity extends Activity {Private IStockQuoteService2 stockService2 = null;... ...Private
Flag_activity_clear_top":Assume that the current activity's task stack is mainactivity–> a–> b–> Active (if we press the back key, we return b,a, and finally mainactivity. Now intent to evoke mainactivity and find that it exists on the stack, then it is clear that it and all before it, and after the new activity is aroused, the task stack is mainactivity. Note that by tracking the activity object, a new instance of mainactivity will be generated, not
The articles reproduced can only be used for non-commercial nature, and can not be accompanied by virtual currency, points, registration and other additional conditions. Reprint must indicate the source: http://blog.csdn.net/flowingflying/Before we have learned how to issue apk, see Pro Android Learning Note (64): Security and Permissions (1): Issue apk, we will learn more about the package.Each apk has a
the user";//toast is a message box without a button that disappears after a certain amount of time and is well suited for debug. Toast.maketext (this, S, Toast.length_long). Show (); }}The benefit of implementing dialog through fragment is that the Fragment manager can automatically regain its original state without human intervention if the activity configuration changes (e.g., steering) are refactored.The example code covered in this blog post can be downloaded in
In Android development, resources include files or values that are bundled with the application and do not have to be written to die in the source code, so we can change or replace them without recompiling the app.Understanding Resource CompositionRefer to Reading Android learning notes (38): Resource resource (top), XML parsing (xmlpullparser), Android learning Note (39): Resource resource (bottom).Strings Resources . Located under Res/values, you ca
;Android:title= "Action2"android:icon= "@drawable/creep002"android:showasaction= "Ifroom"/>Android:title= "Action3"android:icon= "@drawable/creep003"android:showasaction= "Ifroom"/>... ...If we ask for too many menu items to be displayed in action Bar, then the normal Optionsmenu position is displayed, for example, we set 6 menu items, and the properties are: android:showasaction= "Ifroom", Shown below:If some properties are not set to showasaction in the menu's XML file, the item is displayed a
)ReturnString queryaction = Intent.getaction (); if (Intent.ACTION_SEARCH.equals (Intent.getaction ())) {//If it is called through Action_search, that is, if it is called through a searchString queryString = Intent.getstringextra (searchmanager.query); Get Search Content... ...}}... ...}For references see: http://developer.android.com/training/search/setup.htmlThe example code covered in this blog post can be downloaded in Pro Android Learning: Action
() {HttpURLConnection urlconn = null;try{URL url = new URL ("Http://blog.csdn.net/flowingflying1");//This is an invalid address, expected to reply 403Urlconn = (httpurlconnection) url.openconnection ();/ * "3" Processing request body */Urlconn.setdooutput (true);Set allow output, which can be provided with the request bodyFor better performance, you should set setfixedlengthstreamingmod (int) or setchunkedstramingmode (int). If not set, the request will be with the buffer has completed the body
", "Greek", "Spainish"});Mt.setadapter (AA);by Settokenizer () tell me what to divide and when to start matching. The partitioning method is provided by implementing the Multiautocompletetextview.tokenizer interface. The system has implemented two, one is commatokenizer, separated by commas (including a space), and the other is Rfc822tokenizer, used in email format. If you want to implement it yourself, you can refer to the two examples of system implementations.Mt.Settokenizer(New Multiautocomp
+ +, + tv_contextmenu_base + +, "sub.1");Submenu.add (Menu.none,tv_contextmenu_base + 101, + Tv_contextmenu_base + 101, "Sub.2");}ContextMenu and Optionmenu are different in initialization, optionmenu occurs when activity is created, and ContextMenu is triggered each time a mouse event is pressed. For the same view, Oncreatecontextmenu () is called each time a long key is pressed. It is important to note that each time a new ContextMenu object is ret
Pro Android Learning Note (48): ActionBar (1): Home icon AreaMarch 10, 2013 ? Integrated? A total of 3256 words? SizeXiao Zhong da ? Comments Off Actionbar is introduced for tablets in the Android 3.0 SDK and can be used in phones in 4.0. There are three different forms of tab-and menu-like effects in title: Tabbed Action bar,list Action Bar and standard Action Bar, which we'll demonstrate in a small exampl
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.