《安卓android网上订餐点餐菜系统源代码.docx》由会员分享,可在线阅读,更多相关《安卓android网上订餐点餐菜系统源代码.docx(9页珍藏版)》请在优知文库上搜索。
1、privateclassIoadAsyncTaskextendsAsyncTask0OverrideprotectedvoidonPreExecute()dialog=PrOgreSSDiaIog.s/?。W(DiSheSLiStACtivity.this,“提示二”获取中“);0VerrideprotectedStringdoInBackground(String.params)Stringjson=null;ServerUrl=AppConstant.gettrL(getApplicationContext()+ServletService?Action=getdisheslist&msg
2、=+params0;json=httpHelper.HttpRequest(ServerUrl);returnjson;0OverrideprotectedvoidOnPostExecute(Stringresult)super.OnPostExecute(result);dialog.dismiss();list=newArrayList();if(result!=null&result.trim().length()0)tryjSonArray=newJSoNArray(result);for(inti=0;i0VerrideprotectedvoidonPreEecute()dialog
3、=ProgressDialog.sho(PlaceOrderActivity.this,提示“,”获取中,请稍后.”);0VerrideprotectedStringdoInBackground(String.params)StringUrlString=AppConstant.gett/rL(getApplicationContext()+,ServletServicePAction=getOneRow;UrlString=UrlString+&Table=seats;Stringjson=httpHelper.HttpRequest(UrlString);returnjson;0Verri
4、deprotectedvoidOnPostExecute(Stringresult)super.OnPostExecute(result);dialog.dismiss();if(result.trim().length()0)tryjSonArray=newJSONArray(result);LinearLayout11=null;for(inti=0;iInteger.VaIUeof(id);setSel(););11.addView(imageview);if(i%6=0)IlSeat.addView(ll);catch(JSONExceptione)e.printStackTrace(
5、);privateclassIoadAsyncTaskextendsASynCTaSk0OverrideprotectedvoidonPreExecute()dialog=ProgressDialog.shk(MyOrdersListActivity.this,“提示“,”获取中.);0OverrideprotectedStringdoInBackground(String.params)Stringjson=null;ServerUrl=AppConstant.gettrL(getApplicationContext()+ServletService?Action=getmyordersli
6、st&userid=+user.getld();json=httpHelper.HttpRequest(ServerUrl);returnjson;0OverrideprotectedvoidOnPostExecute(Stringresult)super.OnPostExecute(result);dialog.dismiss();list=newArrayList();if(result!=null&result.trim().length()0)tryjsonArray=new3SONArray(result);for(inti=0;ijSonArray.length();i+)json
7、Object=jsonArray.getJSONObject(i);ordersmodel=neworders();model,setld(jsonObject.getlnt(,idu);model.SetAmount(jsonObject.getDouble(amount);model.SetCreatetime(jsonObjectgetString(createtime);model.setSeat(jsonObject.getString(,seat);model.setPrice(jsonObject.getDouble(price);model.SetUsername(jsonOb
8、ject.getString(title);model.setlmg_url(jsonObject.getString(img_url);model.setStatus(jsonObject.getlnt(,status,);list.add(model);catch(JSONExceptione)e.printStackTrace();elsetoastUtiLShoW(没有数据”);adapter=newOrdersAdapter(MyOrdersListActivity.thislist);Iistviewl.setAdapter(adapter);packagecom.mm.meala
9、pp.activity;importorg.json.JSONArray;importorg.json.JSONException;importandroid.app.ProgressDialog;importandroid.content.Intent;importandroid.graphics.BitmapFactory;importandroid.os.AsyncTask;importandroid.os.Bundle;importandroid.text.TextUtils;importandroid.view.View;importandroid.widget.Button;importandroid,widget.ImageView;importandroid.widget.TextView;importcom.miebo.utils.AsyncImageLoader;importcom.miebo.utils.BaseActivity;*authorzlus*/publicclassGoodDetailActivityextendsBaseActivityprivateintid=