This cottage a new version of the list of QQ slide Delete, the last article on the slide to delete the QQ, speculated that the principle is ListView itself each item there is a button, but the general state of the hidden off, detect the left slide when the event pops up hidden button, However, when you switch button state, you give the button a show and hidden animation. This listview is implemented below.
Android development-use advanced RecyclerView to delete a slide menu (SwipeRecyclerView ),
Before using this function, let's briefly introduce this SwipeRecyclerView. This is Yan ZhenJie's advanced RecyclerView modified and encapsulated based on RecyclerView. It can implement a slide-deletion menu like the QQ chat interface, and some advanced functions, I will not list them here
If you want to know more,
With the Android project, if you do not delete the useless resources in time to install the package will be more and more large, it is time to tidy up the discarded resources shrink package, young!In fact, to determine whether a resource (drawable,layout) is not used very simple, the file name (does not include the suffix) to go to the document to look for the line, not found there is no use, directly delet
First, look at the effect
This is an input text box with a Delete button, you need to create a new class to inherit from the EditText, post the code first, and then explain:
The sample code is as follows:
public class Edittextwithdel extends EditText {private final static String TAG = "Edittextwithdel";
Private drawable imginable;
Private context Mcontext;
Public Edittextwithdel {This (context, NULL, 0);
Public Edittextwithdel (context,
The example in this article describes the Android implementation WebView Delete cache method. Share to everyone for your reference. Specifically as follows:
To delete a cache stored on your phone:
Clear the cache before time numdays
private int Clearcachefolder (File dir, long numdays) {
int deletedfiles = 0 ;
if (dir!= null dir.isdirectory ()) {
Is there a good way to delete databases on Android real machines? Can I use file explorer on ddms to delete databases under data/on the real machine? You need to use the re manager to modify the read and write permissions of the folder before you can perform the operation. Or can you use the ADB command Su to execute it? After modification, you can
Arrayadapter provides the Remove method to delete data from the data source and to refresh the interface. Here is its source code:public void Remove (T object) { synchronized (mLock) { if (moriginalvalues! = null) { Moriginalvalues.remove ( object); } else { Mobjects.remove (object); } } if (Mnotifyonchange) notifydatasetchanged ();//Notify Observer }Here is an exam
(index); Is the data that gets the specified subscript index to int type; int id = cursor.getint (cursor.getcolumnindex ("id")) ; String named = cursor.getstring (Cursor.getcolumnindex ("name")); String number = cursor.getstring (Cursor.getcolumnindex ("number"));//Instantiate query result data Object person = new person (ID, named, number);} Close the database connection, release the Resource Db.close ();//Return the data result object return person; /** * Update a data based on name * * @para
1. Get to the location where the cursor is locatedint index = Edittext.getselectionstart ();2. Inserting characters at the cursor locationint index = edittext.getselectionstart (); Editable Editable =" hahaha "); 3. Delete the character before the cursor (where the cursor begins to delete)int index = edittext.getselectionstart (); Editable Editable = edittext.gettext (); Editable.delete (index-1, index);
You need to modify the ListView class override Onintercepttouchevent () and ontouchevent ()//experiment with another method, overwriting the ontouchevent () of the drag icon in each row of the ListView, but the effect is not ideal. public class Mainactivity extends Activity {deleteadapter Deleteadapter;draglistview listview;boolean bflag;i Magebutton button; @Overridepublic void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Setcontentview (r.layout.activity_main);d e
Solve the problem of using third-party library. so to automatically delete Android
1. In the new directory prebuilt under the jni directory, the new file Androidusc. mk under this directory (the name can be obtained at will), copy the third-party library. so to this directory
2. Open Androidusc. mk to add the content. For example, the third-party library is libScreenPop. so:
LOCAL_PATH: = $ (call my-di
Original URL: http://www.cnblogs.com/nuistlr/archive/2012/09/07/2675649.htmlThe first thing to do is inherit Onitemlongclicklistenerpublic class Set_music extends listactivity implements onitemlongclicklistener{Then Set permissions:Getlistview (). Setonitemlongclicklistener (this);overriding methodpublic boolean Onitemlongclick (adapterviewLong Arg3) {String str = list.get (arg2). Get ("name");Delete the long-pressed itemList.remove (ARG2);Dynamic Upd
Micro-Letter Dialog list Sliding Delete effect is very good, for reference to the GitHub on the Swipelistview (Project address: Https://github.com/likebamboo/SwipeListView), on which a number of refactoring, Finally realized the Micro-letter dialog list sliding Delete effect.
Implementation principle1. Through the listview pointtoposition (int x, int y) to get the pressed position and then through android.
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.