Friday, 4 April 2014

1 Private String TitleName[]={"Google ", "Facebook","LinkedIn","Twitter","Tech Crunch"}; 

ArrayList<string> array_sort=new ArrayList<string> (Arrays.asList(TitleName));



2. List : A List is a collection which maintains an ordering for its elements. Every element in the List has an index. Each element can thus be accessed by its index, with the first index being zero. Normally, Lists allow duplicate elements, as compared to Sets, where elements have to be unique.
3.TextWatcher -  Call addTextChangedListener(new TextWatcher()) to implement 
When an object of a type is attached to an Editable, its methods will be called when the text is changed. it has three abstract Methods .return type is void 

1. afterTextChanged(Editable s)
This method is called to notify you that, somewhere within s, the text has been changed.
but be careful not to get yourself into an infinite loop, because any changes you make will cause this method to be called again recursively. 
(You are not told where the change took place because other afterTextChanged() methods may already have made other changes and invalidated the offsets. But if you need to know here, you can use setSpan(Object, int, int, int) in
onTextChanged(CharSequence, int, int, int) to mark your place and then look up from here where the span ended up.

2. beforeTextChanged(CharSequence s, int start, int count, int after)
This method is called to notify you that, within s, the count characters beginning at start are about to be replaced by new text with length after.

3. onTextChanged(CharSequence s, int start, int before, int count)
This method is called to notify you that, within s, the count characters beginning at start have just replaced old text that had length before.
For Example and Code : Click Here

3. Data updates in the adapter
The notifyDataSetChanged() method on the adapter is called if the data has changed or if new data is available.
The notifyDataSetInvalidated() method is called if the data is not available anymore.
4. The setAdapter() method then sets a custom adapter (ImageAdapter) as the source for all items to be displayed in the grid. .

No comments:

Post a Comment