, когда я вызываю метод моего inteface getRepo, он показывает ошибку. Методы обслуживания не могут вернуть void для метода Github.getRepo, когда я запускаю и проверяю отладочную ошибку в interfac call wher i make метод getRepoне может использовать retofit 2.0 Beta в android
my mainActivity mtehod to call the api is
Github api = GitHubService.getService();
api.getRepo("basil2style", new Callback<Repository>() {
@Override
public void onResponse(Call<Repository> call, Response<Repository> response) {
}
@Override
public void onFailure(Call<Repository> call, Throwable t) {
}
});
And my model class is
package functionapps.retrofitdemo.AsyncHelper;
public class Repository {
public String name;
public Repository(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
this is my interface and its calling class
public interface Github {
@GET("https://stackoverflow.com/users/{user}")
public void getRepo(@Path("user") String user, Callback<Repository> response);
}
public class GitHubService {
private static String API_URL = "https://api.github.com";
public static Github getService() {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(API_URL)
.build();
Github github = retrofit.create(Github.class);
return github;
}
Пожалуйста, поделитесь StackTrace и разделяют версию модернизации, а также ... как бета2 или 3 .... –
com.squareup.retrofit2: переоснащения: 2.0.0-Beta4 –
Пожалуйста, разделяющие StackTrace .. –