我有MVC项目,我试图在动作链接点击上调用其他Web应用程序aspx页面。如何在ActionResult中传递该链接或返回视图()。
答案 0 :(得分:1)
使用Controller的 RequestQueue requestQueue = Volley.newRequestQueue(this);
String url = "http://myapi-oh.fr/v2/podcasts/x/shows/" + points.get(0).getShowId() + "/streams";
RequestFuture<JSONObject> future = RequestFuture.newFuture();
JsonObjectRequest request = new JsonObjectRequest(url, null, future, future);
requestQueue.add(request);
try {
JSONObject response = future.get(10, TimeUnit.SECONDS);; // this will block (forever)
points.get(0).setStreamUrl(response.getJSONArray("result").getJSONObject(0).getString("url"));
} catch (InterruptedException e) {
Log.d(TAG, "error : " + e);
// exception handling
Log.d(TAG, "error : " + e);
} catch (ExecutionException e) {
// exception handling
Log.d(TAG, "error : " + e);
} catch (JSONException e) {
e.printStackTrace();
Log.d(TAG, "error : " + e);
} catch (TimeoutException e) {
e.printStackTrace();
}
方法。
Redirect()