当我使用参数(URL和prams)调用函数时,在主活动的结果内部未返回登录名。 其返回null,然后实现烤面包,然后继续执行我的功能。
promisefunction()
.then((resolve, reject) => {
if (reject)
{
agent.add("I am sorry for the inconvenience but an error happened during your last call.");
agent.add("Please try in a while");
}
else
agent.add("SUCCESS");
}
答案 0 :(得分:0)
Volley不会返回值,您需要检查其他方法,例如直接在要从API获取响应的函数中显示敬酒,如下所述:
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Toast.makeText(MainActivity.this,response,Toast.LENGTH_LONG).show();
myresponse =response;
**/////get all the data here and show that into the response.**
}
},