|
|
@@ -21,6 +21,7 @@ import android.util.Log;
|
|
|
//import com.usai.apex.TradeFilingApplication;
|
|
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
|
|
|
|
+import com.usai.ratradefiling.R;
|
|
|
import com.usai.ratradefiling.RootActivity;
|
|
|
import com.usai.ratradefiling.TradeFilingApplication;
|
|
|
import com.usai.ratradefiling.my.CheckSavedActivity;
|
|
|
@@ -315,7 +316,17 @@ public class OnlineDataProvider extends com.usai.redant.rautils.utils.Network
|
|
|
private static JSONObject handleJson(String jsonStr) {
|
|
|
|
|
|
if (jsonStr == null || jsonStr.isEmpty()) {
|
|
|
- return null;
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ json.put("result",RESULT_NET_ERROR);
|
|
|
+ json.put("err_msg",TradeFilingApplication.getInstance().getText(R.string.msg_net_resulterror));
|
|
|
+ } catch (JSONException e)
|
|
|
+ {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return json;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
@@ -534,6 +545,20 @@ public class OnlineDataProvider extends com.usai.redant.rautils.utils.Network
|
|
|
|
|
|
public static String getJson(String url, Bundle parms)
|
|
|
{
|
|
|
+ if(!NetworkIsAvailable())
|
|
|
+ {
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ json.put("result",RESULT_NET_NOTAVAILABLE);
|
|
|
+ } catch (JSONException e)
|
|
|
+ {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return json.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
prepare_addtional_params(parms);
|
|
|
return com.usai.redant.rautils.utils.Network.getJson(url, parms, REQUEST_TIMEOUT);
|
|
|
}
|