Delete a directory with DDMS

Unfortunately you can’t.

The only way to delete a directory from a Android device connected with adb is to execute:

adb shell rm -r /path/to/dir

and only if you have permissions, ie you have a rooted device or you are working with Android’s emulator.

Share

How to add divider in ListView

In order for this code snippet to work, you must add item names starting with “-” where you want to add a divider.

public View getView(int position, View convertView, ViewGroup parent) {
 
        if(items.get(position).get("name").startsWith("-")){
                View divider = mInflater.inflate(R.layout.progressbar, null);
                return divider;
        }
//Implement the rest of the getView here
}
Share