Unknown Host Exception Only in ONEPLUS 6T and Other Pie mobile are working fine

169 Views Asked by At

Unknown Host Exception Only in ONEPLUS 6T and Other Pie mobile are working fine when refreshed three to four times then gets data otherwise getting error

logcat-Access denied finding property “vendor.debug.egl.swapinterval"
tried solutions:-

1.>

<network-security-config>
<base-config cleartextTrafficPermitted="true"/>
<debug-overrides>
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>

2.>
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
android:usesCleartextTraffic="true"

3.>

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">http://www.sanjarcreation.com/</domain>
    </domain-config>
    </network-security-config>

public void parseHomeCategorydata(Context context){
        RequestQueue requestQ = Volley.newRequestQueue(context);
        JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, Const.Base_Url+"manage/api/p_category/all/?X-Api-Key="+Const.API_KEY+"&start=0&limit=100&field=shop_id&filter="+Const.Shop_id+"&parent=0" , null, new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                try {
                    JSONObject jsonObject = response.getJSONObject("data");
                    JSONArray jsonArray = jsonObject.getJSONArray("p_category");
                    homeCategoryRecModelArrayList = Parser.parseHomeCategoryList(jsonArray);
                    homeCategoryRecAdapter = new HomeCategoryRecAdapter(context , homeCategoryRecModelArrayList);
                    recyclerViewCategory.setAdapter(homeCategoryRecAdapter);
//                    parseSliderData(context);

                } catch (JSONException e) {

                    e.printStackTrace();
                }
            }
        },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        if(error.getMessage()==null){
                            Toast.makeText(context, "Failed to retrieve data", Toast.LENGTH_LONG).show();
                        }
                        else{
                            Toast.makeText(context, error.getMessage().toString(), Toast.LENGTH_LONG).show();
                        }

                    }
                }
        );
        requestQ.add(jsonObjectRequest);
    }

enter image description here

0

There are 0 best solutions below