Public View GetView (int position, View Convertview, ViewGroup parent) {
View Convertview: The value that appears at startup is cached in (View) Convertview
If it is currently empty, the layout is loaded
View view;
if (cenvertview==null) {
View = View.inflate (Getapplicationcontext (), r.layout.lv_item,null);
}
//If not empty, assign the cached value to the view
else{
View=convertview;
}
TextView tv_name = (TextView) View.findviewbyid (r.id.tv_name);
TextView Tv_phone = (TextView) View.findviewbyid (R.id.tv_phone);
}
Statement Description:
Loads a bunch of content when the app starts, and the loaded content is placed in the view, such as when you move the page up and down, and you keep loading data into the view. This takes up a lot of memory, the content of the time is good, if the content of more, the memory will be very large. This is the time for caching optimizations. The IF statement to determine whether the content will be loaded in the cache of the view is empty, if it is empty, load the data, if not empty, the loaded content is assigned to the view, this does not need to load the data again. This enables caching optimizations.
about the matches regular expression of the number of shaping : Matches ("\\d{11}"): The number is 11 bits, Matches ("\\d{6,11}") indicates that the number displayed is between 6-11.
This article is from the "Android Small Notes" blog, please be sure to keep this source http://dreamwing.blog.51cto.com/9872128/1610900
Android Small Notes