Text:
TextView: Marquee Four lines of code, custom controls
EditText Special properties: Hint InputType
Autocompletetextview Special properties: Hint,completionthreshold requires an adapter layout file to choose Android. R.layout.simple_list_item1
Multiautocompletetextview Special properties: Completionthreshold requires an adapter
Image:
ImageView Special properties: Backgroud,src Backgroud can also set the background color
Button:
Button has the Text property Onclicklistener ()
ImageButton has the SRC attribute and the background attribute, without the Text property Onclicklistener ();
ToggleButton Special properties: Checked,texton,textoff requires a oncheckchangelistener ()
check box
CheckBox Special attribute: checked requires a oncheckchangelistener ()
Radiogroup,radiobutton Special Properties: orientation;checked multiple selection of one oncheckchangelistener ()
Event:
Onclicklistener (Listenner) Oncheckchangelistener (Listener)
Three ways to implement events:
1, Anonymous inner class
2, the way to implement the interface
3, external class (used when all buttons are required to implement the same function)
Adapter adapter:
Create adapter First
arrayadapter<string> adapter= New Arrayadapter<string> (this,//context, layout file, data source
Android. R.layout.simple_list_item_1, RES);
Autoc.setadapter (adapter); To bind a control to an adapter
Toast.maketext (mainactivity.this, "Anonymous inner Class", 1). Show ();
Here are the questions and workarounds:
1, the new Android project does not have a R.java file
Just tick in front of the build automatically option in Project dropdown.
2. Change the layout
Refator--android--changelayout
3, create a new activity and add it in Androidmanifest
4, Anonymous internal class context fill in: Activity name. This
Overview of the Android entry controls