Commit b26227e7 authored by Muhammad Suryono's avatar Muhammad Suryono

Update

parent a847797c
...@@ -188,7 +188,8 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -188,7 +188,8 @@ public class FormProductActivity extends AppCompatActivity {
HashSet<String> set = new HashSet<>(); HashSet<String> set = new HashSet<>();
List<String> str = new ArrayList<>(); List<String> str = new ArrayList<>();
categoryModels = new ArrayList<>(); categoryModels = new ArrayList<>();
if (productModelsIntent == null){ Log.i("GET_CATEGORY", "setSpinner: "+utils.convertGson(productModelsIntent));
if (productModelsIntent.getCategoryProduct() == 0){
str.add("SELECT CATEGORY"); str.add("SELECT CATEGORY");
}else{ }else{
str.add(getCategoryById(productModelsIntent.getIdProduct())); str.add(getCategoryById(productModelsIntent.getIdProduct()));
...@@ -337,11 +338,11 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -337,11 +338,11 @@ public class FormProductActivity extends AppCompatActivity {
} }
private String getCategoryById(int s) { private String getCategoryById(int s) {
CategoryServise categoryServise = client.Client(CategoryServise.class); CategoryServise categoryServise = client.Client(CategoryServise.class);
categoryServise.getCategoryId(s).enqueue(new Callback<DataResponse<CategoryModels>>() { categoryServise.getCategoryId(s).enqueue(new Callback<DataResponse<CategoryModels>>() {
@Override @Override
public void onResponse(Call<DataResponse<CategoryModels>> call, Response<DataResponse<CategoryModels>> response) { public void onResponse(Call<DataResponse<CategoryModels>> call, Response<DataResponse<CategoryModels>> response) {
Log.i("ER", "onResponse: "+utils.convertGson(response.body()));
categoryName = response.body().getData().getNameCategory(); categoryName = response.body().getData().getNameCategory();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment