I am developing a Xamarin.Android application. Whenever I try to load a JSON feed, I get an error . "Your application has entered an interrupt state, but there is no code because all threads executed external code . "
Here is a screenshot of the error 
My json feed download code
string url = "http://xamdev.epizy.com/getData1.php"; public async void downloadJsonFeedAsync(String url) { var httpClient = new HttpClient(); Task<string> contentsTask = httpClient.GetStringAsync(url); // await! control returns to the caller and the task continues to run on another thread string content = await contentsTask; Console.Out.WriteLine("Response Body: \r\n {0}", content); //Convert string to JSON object result = Newtonsoft.Json.JsonConvert.DeserializeObject<RootObject> (content); //Update listview RunOnUiThread (() => { listView.Adapter = new CusotmListAdapter(this, result.posts); progress.Visibility = ViewStates.Gone; }); }
I have an error in this line
string content = waiting for contentsTask;
This is my json
{"position": [{"Identifier": "1", "URL": "," title ":" Convert speech to text in an Android application "," date ":" 2017-06-16 06:15: 18 "," content ":" Convert Speech to Tex Convert Speech to Text in an Android application convert speech to text in an Android application in an Android application "," Lenfilm ":" HTTP: \ / \ / stacktips.com \ / -content \ / downloads \ / 2017 \ / 01 \ /Speech-to-Text-in-Android-375x300.jpeg "}]}
Please someone tell me what happened to my code? Thanks in advance.
Here is my phs webservice code -
<?php if($_SERVER['REQUEST_METHOD']=='GET'){ require_once('conn.php'); $sql = "SELECT * FROM space"; if ($result = mysqli_query($conn, $sql)) { $resultArray = array(); $tempArray = array(); while($row = $result->fetch_object()) { $tempArray = $row; array_push($resultArray, $tempArray); } echo json_encode(array("result"=>$resultArray)); } mysqli_close($conn); } ?>
source share