嗨,我正在使用 android 轮并获取时间值如下
//get values of the wheel
hourvalue = hours.getCurrentItem();
Log.d(TAG, "hour value" +hourvalue );
minutevalue = mins.getCurrentItem();
Log.d(TAG, "minute value" +minutevalue );
我想将它们作为字符串传递给一个方法,我该怎么做,我还要分别获取小时和分钟的值我想将小时和分钟存储在一个字符串变量anAndroid中:警报dailog中的numberpicker
private String getTraceId(String fbuserser,int hour) {
String traceId = null;
HttpClient client = new HttpClient();
GetMethod get = null;
try {
get = new GetMethod("http://" + Constants.CLOUD_SERVER_URL
+ Constants.facebookTrace);
NameValuePair[] params = new NameValuePair[4];
NameValuePair param = new NameValuePair();
param.setName("gadget");
param.setValue("gettraceid");
params[0] = param;
param = new NameValuePair();
param.setName("fbuserid");
param.setValue(fduserUser);
params[1] = param;
param = new NameValuePair();
param.setName("expiry");
-------------> param.setValue(hour);
params[2] = param;
get.setQueryString(params);
int statusCode = client.executeMethod(get);
traceId = get.getResponseBodyAsString();
} catch (Exception e) {
Log.e(TAG, "For Facebook Trace Id:", e);
} finally {
get.releaseConnection();
get = null;
}
return traceId;
在上述方法中,我想int hour
作为字符串传递。感谢任何帮助