Android listview line details display page writing and drop-down refresh implementation
Listview row details display page:
The lightweight fragment is used to realize the simple detailed display of listview line content:
It is worth noting that:
1. The main layout (the activity that opens it) must be a FrameLayout layout (frame layout, superimposed up and down)
2. If the buttons of the main layout cannot be overwritten, you can add: Android: statelistanimator = "@ null" in the button property
3. To prevent penetration, click to find the view in the fragment class and add: view object. Setclickable (true);
4. If import android.support.v4.app.fragment is used; Getsupportfragmentmanager is used for package operation; otherwise, if import android.app.fragment is used; Package, the operation uses getfragmentmanager
Layout writing of fragment class:
Fragment class logic writing:
Some codes in the listview listening event of activity:
Event listening based on simpleadapter in the previous article
Return and exit of activity:
Listview drop-down refresh implementation:
Baseadapt view and data implementation based on the previous article
When the interface content changes, set swiperefreshlayout:
Must be set here:
Set as a global object, you cannot create a new object every time you get data, otherwise you need to initialize the adapter class every time.
Refresh control listening: