I got the same error, but when i did as below, it resolved the issue.
Instead of writing like this:
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
use the below one:
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);