Android 变量t从未使用过
下面是我的load_data java类。我只得到了屏幕上显示的变量s,因为“变量t从未使用过”。有人能告诉我在哪里能找到它吗Android 变量t从未使用过,android,variables,Android,Variables,下面是我的load_data java类。我只得到了屏幕上显示的变量s,因为“变量t从未使用过”。有人能告诉我在哪里能找到它吗 package etn.transport.transporteexpress; import... import java.io.IOException; import java.util.ArrayList; import java.util.List; public class display_clicked_load extends AppCompatAc
package etn.transport.transporteexpress;
import...
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class display_clicked_load extends AppCompatActivity {
String id;
String loginemail;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display_clicked_load);
mLockScreenRotation();
Button send = (Button) findViewById(R.id.sendbutton);
id = getIntent().getStringExtra("id");
String shipping_date = getIntent().getStringExtra("shipping_date");
String shipping_time = getIntent().getStringExtra("shipping_time");
String shipping_address_address = getIntent().getStringExtra("shipping_address_address");
String shipping_address_postal_code = getIntent().getStringExtra("shipping_address_postal_code");
String shipping_address_city = getIntent().getStringExtra("shipping_address_city");
String shipping_address_nation = getIntent().getStringExtra("shipping_address_nation");
String description = getIntent().getStringExtra("description");
String weight = getIntent().getStringExtra("weight");
String destination_date = getIntent().getStringExtra("destination_date");
String destination_time = getIntent().getStringExtra("destination_time");
String destination_address_address = getIntent().getStringExtra("destination_address_address");
String destination_address_postal_code = getIntent().getStringExtra("destination_address_postal_code");
String destination_address_city = getIntent().getStringExtra("destination_address_city");
String destination_address_nation = getIntent().getStringExtra("destination_address_nation");
//loginemail = getIntent().getStringExtra("loginemail");
loginemail=global.email1;
TextView loaddate = (TextView) findViewById(R.id.txtloaddate);
TextView loadtime = (TextView) findViewById(R.id.txtloadtime);
TextView loadplace = (TextView) findViewById(R.id.txtloadplace);
TextView txtdesc = (TextView) findViewById(R.id.txtdescription);
TextView txtweight = (TextView) findViewById(R.id.txtweight);
TextView txtdestdate = (TextView) findViewById(R.id.txtdestinationdate);
TextView txtdesttime = (TextView) findViewById(R.id.txtdestinationtime);
TextView txtdestplace = (TextView) findViewById(R.id.txtdestplace);
/* String s = "<b>Shipping Date:</b>" + shipping_date.toString();
loaddate.setText(Html.fromHtml(s));
String t = "<b>Time:</b>" + shipping_time.toString();
loadtime.setText(Html.fromHtml(t));
String u = "<b>shipping_address</b>" + shipping_address_address.toString();
loadplace.setText(Html.fromHtml(u));
String v = "<b>Description:</b>" + description.toString();
txtdesc.setText(Html.fromHtml(v));
String w = "<b>Weight:</b>" + weight.toString() + " KG";
txtweight.setText(Html.fromHtml(w));
String x = "<b>Destination Date:</b>" + destination_date.toString();
txtdestdate.setText(Html.fromHtml(x));
String y = "<b>Time:</b>" + destination_time.toString();
txtdesttime.setText(Html.fromHtml(y));
String z = "<b>Destination Address:</b>" + destination_address_address.toString();
txtdestplace.setText(Html.fromHtml(z));
*/
String s = getResources().getString(R.string.shipping_date, shipping_date.toString());
loaddate.setText(Html.fromHtml(s));
String t= getResources().getString(R.string.shipping_time, shipping_time.toString());
/* loaddate.setText(Html.fromHtml(t));
String u= getResources().getString(R.string.shipping_address_c, shipping_address_address.toString());
loaddate.setText(Html.fromHtml(u));
String v= getResources().getString(R.string.transport_description_c, description.toString());
loaddate.setText(Html.fromHtml(v));
String w= getResources().getString(R.string.weight, weight.toString());
loaddate.setText(Html.fromHtml(w));
String x= getResources().getString(R.string.destination_date, shipping_date.toString());
loaddate.setText(Html.fromHtml(x));
String z= getResources().getString(R.string.destination_time, destination_time.toString());
loaddate.setText(Html.fromHtml(y));
String z= getResources().getString(R.string.destination_address, destination_address.toString());
loaddate.setText(Html.fromHtml(z));
/* loaddate.setText(Html.fromHtml(s));
loadtime.setText("Time:" + shipping_time.toString());
loadplace.setText("Shipping Address:" + shipping_address_address);
txtdesc.setText("Description:" + description);
txtweight.setText("Weight: " + weight + " KG");
txtdestdate.setText("Destination Date:" + destination_date.toString());
txtdesttime.setText("Time:" + destination_time.toString());
txtdestplace.setText("Destination Address:" + destination_address_address);
*/
send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new myTask().execute();
}
});
}
class myTask extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
Log.d("inside", "onPre");
}
@Override
protected Void doInBackground(Void... voids) {
Log.d("inside", "DoIn");
sendData();
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
AlertDialog.Builder dlgAlert = new AlertDialog.Builder(display_clicked_load.this);
dlgAlert.setMessage("Quotation Send Successfully");
dlgAlert.setTitle("Quotation Confirmation");
dlgAlert.setPositiveButton("OK", null);
dlgAlert.setCancelable(true);
dlgAlert.create().show();
}
}
public void sendData() {
try {
String ssendoffer;
String email;
// email=getIntent().getStringExtra("loginemail");
EditText sendoffer = (EditText) findViewById(R.id.sendoffer);
ssendoffer=sendoffer.getText().toString();
loginemail=global.email1;
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.testsite.com/folder/myfile.php");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(13);
nameValuePairs.add(new BasicNameValuePair("amount", ssendoffer));
nameValuePairs.add(new BasicNameValuePair("email",loginemail));
nameValuePairs.add(new BasicNameValuePair("quotation_id",id));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse hresponse = httpclient.execute(httppost);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("error....", e + "");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("error.......", e + "");
}
}
private void mLockScreenRotation() {
// Stop the screen orientation changing during an event
switch (this.getResources().getConfiguration().orientation) {
case Configuration.ORIENTATION_PORTRAIT:
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
break;
case Configuration.ORIENTATION_LANDSCAPE:
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
break;
}
}
}
包裹etn.transport.transporteexpress;
导入。。。
导入java.io.IOException;
导入java.util.ArrayList;
导入java.util.List;
公共类显示\u单击\u加载扩展AppCompative活动{
字符串id;
字符串逻辑邮件;
@凌驾
创建时受保护的void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity\u display\u clicked\u load);
mLockScreenRotation();
按钮发送=(按钮)findViewById(R.id.sendbutton);
id=getIntent().getStringExtra(“id”);
字符串shipping_date=getIntent().getStringExtra(“shipping_date”);
字符串shipping_time=getIntent().getStringExtra(“shipping_time”);
字符串shipping_address_address=getIntent().getStringExtra(“shipping_address_address”);
字符串shipping_address_postal_code=getIntent().getStringExtra(“shipping_address_postal_code”);
字符串shipping_address_city=getIntent().getStringExtra(“shipping_address_city”);
字符串shipping_address_nation=getIntent().getStringExtra(“shipping_address_nation”);
字符串描述=getIntent().getStringExtra(“描述”);
字符串权重=getIntent().getStringExtra(“权重”);
字符串destination_date=getIntent().getStringExtra(“destination_date”);
字符串destination_time=getIntent().getStringExtra(“destination_time”);
字符串destination_address_address=getIntent().getStringExtra(“destination_address_address”);
字符串目的地地址邮政编码=getIntent().getStringExtra(“目的地地址邮政编码”);
字符串destination_address_city=getIntent().getStringExtra(“destination_address_city”);
字符串destination_address_nation=getIntent().getStringExtra(“destination_address_nation”);
//loginemail=getIntent().getStringExtra(“loginemail”);
loginemail=global.email1;
TextView加载日期=(TextView)findViewById(R.id.txtloaddate);
TextView加载时间=(TextView)findViewById(R.id.txtloadtime);
TextView加载位置=(TextView)findViewById(R.id.txtloadplace);
TextView txtdesc=(TextView)findViewById(R.id.txtdescription);
TextView txtwweight=(TextView)findViewById(R.id.txtwweight);
TextView txtdestdate=(TextView)findViewById(R.id.txtdestinationdate);
TextView txtdesttime=(TextView)findViewById(R.id.txtdestistationtime);
TextView txtdestplace=(TextView)findViewById(R.id.txtdestplace);
/*String s=“发货日期:”+Shipping_Date.toString();
loaddate.setText(Html.fromHtml);
String t=“Time:+shipping_Time.toString();
loadtime.setText(Html.fromHtml(t));
String u=“shipping_address”+shipping_address_address.toString();
loadplace.setText(Html.fromHtml(u));
String v=“Description:”+Description.toString();
txtdesc.setText(Html.fromHtml(v));
字符串w=“Weight:”+Weight.toString()+“KG”;
setText(Html.fromHtml(w));
String x=“目的地日期:”+Destination_Date.toString();
txtdestdate.setText(Html.fromHtml(x));
字符串y=“时间:”+destination\u Time.toString();
txtdesttime.setText(Html.fromHtml(y));
String z=“目的地地址:”+Destination\u Address\u Address.toString();
txtdestplace.setText(Html.fromHtml(z));
*/
字符串s=getResources().getString(R.String.shipping_date,shipping_date.toString());
loaddate.setText(Html.fromHtml);
字符串t=getResources().getString(R.String.shipping_time,shipping_time.toString());
/*loaddate.setText(Html.fromHtml(t));
字符串u=getResources().getString(R.String.shipping_address_c,shipping_address_address.toString());
loaddate.setText(Html.fromHtml(u));
String v=getResources().getString(R.String.transport\u description\u c,description.toString());
loaddate.setText(Html.fromHtml(v));
字符串w=getResources().getString(R.String.weight,weight.toString());
loaddate.setText(Html.fromHtml(w));
字符串x=getResources().getString(R.String.destination\u date,shipping\u date.toString());
loaddate.setText(Html.fromHtml(x));
String z=getResources().getString(R.String.destination\u time,destination\u time.toString());
loaddate.setText(Html.fromHtml(y));
String z=getResources().getString(R.String.destination_address,destination_address.toString());
loaddate.setText(Html.fromHtml(z));
/*loaddate.setText(Html.fromHtml);
loadtime.setText(“时间:+shipping_Time.toString());
loadplace.setText(“装运地址:“+装运地址”);
txtdesc.setText(“说明:”+说明);
txtweight.setText(“重量:“+重量+”千克”);
txtdestdate.setText(“目的地日期:+Destination_Date.toString());
setText(“时间:+destination\u Time.toString());
setText(“目的地地址:”+目的地地址);
*/
send.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图){
新建myTask().execute();
}
});
}
类myTask扩展了AsyncTask{
@凌驾
受保护的void onPreExecute(){
super.onPreExecute();
日志d(“内部”、“onPre”);
}
@凌驾
受保护的空位背景(空位…空位){
Log.d(“内部”、“内部”);
sendData();
返回null;
}
@凌驾
受保护的void onPostExecute(void避免){
super.onPostExecute(避免);
AlertDialog.Builder dlgAlert=新建AlertDialog.Builder(显示
String t= getResources().getString(R.string.shipping_time, shipping_time.toString());
/* loaddate.setText(Html.fromHtml(t)); */