Haven't updated the blog for a long time, recently in the company's project, which is my contact with the first formal project. Through the inspection of the project, found oneself accumulated a year of knowledge or far from enough, want to improve,
Add a border to textureview (a professional noun is a stroke), there are three solutions:
1. Set a 9 patch, right border, the middle is empty PNG.
2. Customize a view and draw a border with canvas.
3. Use the shapedrawable provided by Android to
One, color resources1. color XML file format
Copy Code code as follows:
//resources root element
#000000
Color child element
2. Reference format:
Java code: R.color.color_name (This is an int-type data that
The use of Android handler, before speaking handler, we first mention a small problem, is how to let the program 5 seconds update title.First of all, let's take a look at the people who are used to Java programming and how to write the program
In a standard Windows and Linux desktop operating system, you can run multiple applications in a different window at a time, with only one application being the current focus state, but other applications are an equal location. Users can switch each
The structure of EditText in the API
Java.lang.Object
Android.view.View
Android.widget.TextView
Android.widget.EditText
Known Direct subclass:
Autocompletetextview, Extractedittext
Known indirect subclass:
Multiautocompletetextview
We all know that EditText and TextView are Android text input boxes and text display boxes, but based on the size of the phone screen, if you need to enter more text or display more content, the phone screen is far from enough, So the text box has a
Now because Gwf,google basic and we say we see, it is to do Android now or want to learn Android friends bring a lot of inconvenience, the simplest is the Android SDK Manager you can not update.
Now there is a solution, as follows.
1. Start the
In the development will often use the countdown function, including the phone to send verification code, and so on, before my practice is to use handler + Timer + TimerTask to achieve, now found this class, decisively abandoned before the practice,
Executing in OnCreate:
Copy Code code as follows:
public void OnCreate () {
Super.oncreate ();
LOG.I ("TAG", "service Started");
Monitor the caller status of the phoneTelephonymanager Telmanager = (Telephonymanager) This.
Let's show you the effect chart:
The first of several problems encountered in the process:
1, the edittext to customize the background
2, the runtime automatic edittext automatically get focus
3, when the focus is to clear the hint, rather
The context is the object that we often use to write Android programs, meaning contextual objects. The context in which activity is commonly used is still application. Activity is used to show the active interface, contains a lot of views, and the
In view of the current Internet development, more and more Internet enterprises have deployed their clients on the Android platform, and in order to enhance the user experience, these clients have made the layout reasonable and beautiful. The
Objective
Before we begin, we hope you can best meet the following conditions:
1, have a compiled Android source code (hands-on practice will have a more in-depth understanding)
2, a certain understanding of the binder mechanism
This article
This example for you to share the Android to determine the current app state of the specific implementation code for your reference, the specific contents are as follows
First type:
/**
* To determine whether the current application is
Objective
About the use of recyclerview here is not to repeat, I believe that a lot of online search (I also have a simple introduction of the article), this time we are talking about the use of recyclerview in the process, sometimes according to
The following is my summary of the two ways, there is a need for reference.
The first kind: The Fool type, the space acts as (8 space occupies two Chinese characters size).
Textview.settext (" Set first-line indent setting first-line indent
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.