Skip to content

Instantly share code, notes, and snippets.

@guodong1111
Created December 11, 2014 07:10
Show Gist options
  • Save guodong1111/bcdb2f8d74777003e0e2 to your computer and use it in GitHub Desktop.
Save guodong1111/bcdb2f8d74777003e0e2 to your computer and use it in GitHub Desktop.
RequestQueue mQueue = Volley.newRequestQueue(this);
String url = CommonUtilities.API+"portal?v=40&mso="+FliprXApplication.mso+"&lang=zh"+"&time="+new Date().getHours();
StringRequest stringRequest = new StringRequest(url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try{
setInfos = CSV_Parse.parseToSetInfo(response);
if(navigationDrawerFragment != null){
navigationDrawerFragment.setSetInfos(setInfos);
}
for(SetInfo setInfo:setInfos){
getChannel(setInfo);
}
}catch(Exception e){
Toast.makeText(getApplicationContext(), "Wrong id", Toast.LENGTH_SHORT).show();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(SetInfoActivity.this, "onMissConnect: "+error.getMessage(), Toast.LENGTH_SHORT).show();
}
});
mQueue.add(stringRequest);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment