Browse Source

Fixed

Fixed Async issue
pull/1/head
Yiğit Çolakoğlu 7 years ago
parent
commit
44ab8ed26f
5 changed files with 12 additions and 14 deletions
  1. BIN
      FoodCloud.apk
  2. +2
    -1
      FoodCloud/app/src/main/java/gq/yigit/foodcloud/PHPComm.java
  3. +9
    -11
      FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java
  4. +0
    -1
      database/communication/.idea/workspace.xml
  5. +1
    -1
      database/content/Products/1.json

BIN
FoodCloud.apk View File


+ 2
- 1
FoodCloud/app/src/main/java/gq/yigit/foodcloud/PHPComm.java View File

@ -78,8 +78,9 @@ public class PHPComm extends AsyncTask<String,Void,String> {
protected void onPostExecute(String result) {
alertDialog.setMessage(result);
Log.d(TAG, "AlertBoxSet " + result);
json_return = result;
alertDialog.show();
ProductInfo flow = new ProductInfo();
flow.continueApp(result);
}
@Override


+ 9
- 11
FoodCloud/app/src/main/java/gq/yigit/foodcloud/ProductInfo.java View File

@ -90,18 +90,18 @@ public class ProductInfo extends AppCompatActivity implements OnClickListener {
// whenever data at this location is updated.
PHPComm comm = new PHPComm(this);
comm.execute("get", "1", "Products");
try {
json_str = comm.json_return;
while(json_str == null){
json_str = comm.json_return;
continue;
}
}
public void continueApp(String json_str){
try {
Log.d(TAG,"This is a pointer");
//Log.d(TAG,"get json str" + json_str);
//JSONObject jsonObj = new JSONObject(json_str);
}catch (NullPointerException e) {
Log.d(TAG,"get json str" + json_str);
JSONObject jsonObj = new JSONObject(json_str);
}catch (JSONException e) {
Log.d(TAG, "An error occured with the json!");
}catch (NullPointerException e){
Log.d(TAG,"Received null data!");
}
/*
Name = (TextView) findViewById(R.id.name);
@ -151,7 +151,5 @@ public class ProductInfo extends AppCompatActivity implements OnClickListener {
}

+ 0
- 1
database/communication/.idea/workspace.xml View File

@ -129,7 +129,6 @@
</component>
<component name="ToolWindowManager">
<frame x="821" y="342" width="1390" height="988" extended-state="0" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25179857" />
<window_info anchor="bottom" id="TODO" order="6" />


+ 1
- 1
database/content/Products/1.json View File

@ -1 +1 @@
"{\"Allergens\": [\"Lactose\"], \"Cooked\": false, \"Problematic\": false, \"Process\": \"Pastorized\", \"Nutrients\": [\"Protein\", \"Fat\", \"Lactose\", \"Glucose\"], \"BBD\": \"24.08.2018\", \"Calories\": 120, \"Prod_Name\": \"Milk\"}"
{"Allergens": ["Lactose"], "Cooked": false, "Problematic": false, "Process": "Pastorized", "Nutrients": ["Protein", "Fat", "Lactose", "Glucose"], "BBD": "24.08.2018", "Calories": 120, "Prod_Name": "Milk"}

Loading…
Cancel
Save