In this case you should use hashmap
for (int i =0 ; i< count; i++)
{
String data = cursor.getString(i);
String column_name = cursor.getColumnName(i);
HashMap<String,String> map = new HashMap<String,String>();
map.put("column_value",data);
map.put("column_name",column_name);
details.add(map); //change the type of details from ArrayList<String> to arrayList<HashMap<String,String>>
}