square / retrofit

A type-safe HTTP client for Android and the JVM
https://square.github.io/retrofit/
Apache License 2.0
43.09k stars 7.3k forks source link

getting retrofit error while setting date in my ListAdapter file #1077

Closed ojuskulkarni closed 9 years ago

ojuskulkarni commented 9 years ago

MY CODE

TextView employeeName = (TextView) convertView.findViewById(R.id.employeeName); TextView employeeCode = (TextView) convertView.findViewById(R.id.employeeCode); TextView gender = (TextView) convertView.findViewById(R.id.gender); TextView bankBranch = (TextView) convertView.findViewById(R.id.bankBranch); TextView department = (TextView) convertView.findViewById(R.id.department); TextView designation = (TextView) convertView.findViewById(R.id.designation); TextView rcDesignation = (TextView) convertView.findViewById(R.id.rcDesignation); TextView drivingLicenseNumber = (TextView) convertView.findViewById(R.id.drivingLicenseNumber); TextView drivingLicenseType = (TextView) convertView.findViewById(R.id.drivingLicenseType); TextView bank = (TextView) convertView.findViewById(R.id.bank); TextView accountNumber = (TextView) convertView.findViewById(R.id.accountNumber); TextView birthDate = (TextView) convertView.findViewById(R.id.birthDate); TextView joiningDate = (TextView) convertView.findViewById(R.id.joiningDate); TextView drivingLicenseExpiryDate = (TextView) convertView.findViewById(R.id.drivingLicenseExpiryDate); /TextView photoPath = (TextView) convertView.findViewById(R.id.photoPath);/

    // Populate the data into the template view using the data object
    employeeName.setText(emp.getName());
    employeeCode.setText(emp.getEmployeeCode());
    bankBranch.setText(emp.getBankBranch());
    gender.setText(emp.getGender().toString());
    rcDesignation.setText(emp.getRcDesignation());
    department.setText(String.valueOf(emp.getDepartmentId()));
    designation.setText(String.valueOf(emp.getDesignationId()));
    drivingLicenseNumber.setText(emp.getDrivingLicenseNumber());
    drivingLicenseType.setText((emp.getDrivingLicenseType().toString()));
    bank.setText(String.valueOf(emp.getBankId()));
    accountNumber.setText(emp.getAccountNumber());
    birthDate.setText(emp.getBirthDate().toString());
    birthDate.setText(emp.getJoiningDate().toString());
    birthDate.setText(emp.getDrivingLicenseExpiryDate().toString());

ERROR E/StrictMode﹕ A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. java.lang.Throwable: Explicit termination method 'end' not called at dalvik.system.CloseGuard.open(CloseGuard.java:184) at java.util.zip.Inflater.(Inflater.java:82) at com.android.okio.GzipSource.(GzipSource.java:57) at com.android.okhttp.internal.http.HttpEngine.initContentStream(HttpEngine.java:478) at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:668) at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:379) at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:323) at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:491) at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25) at com.google.android.gms.http.GoogleHttpClient.a(SourceFile:791) at com.google.android.gms.http.GoogleHttpClient.b(SourceFile:760) at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:663) at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:654) at com.google.android.gms.playlog.uploader.e.a(SourceFile:346) at com.google.android.gms.playlog.uploader.e.a(SourceFile:232) at com.google.android.gms.playlog.uploader.e.a(SourceFile:204) at com.google.android.gms.playlog.uploader.UploaderService.a(SourceFile:52) at com.google.android.gms.gcm.ap.run(SourceFile:131)

ojuskulkarni commented 9 years ago

not getting actually how to set date..

JakeWharton commented 9 years ago

This has nothing to do with Retrofit. The error is in Google Play Services's GCM implementation which uses Google's HTTP client wrapper called GoogleHttpClient which uses Java's java.net.HttpUrlConnection which happens to be backed by an internal version of OkHttp inside of Android.

You need to report this to the Google Play Services team. I believe they have an issue tracker on Google Code.