私はこのコードを持っています.xml応答が4を超えている場合は正常に機能しますが、値が4以下の場合はラベルを印刷しません.この行は文字列の長さを取得するための正しい形式ですか?
xmlResponse = www.xyz.xml
if(xmlResponse.length<=4)
{
lblTMSNoRecentTransaction = (TextView)
findViewById(R.id.lblTMSNoRecentTransaction);
lblTMSNoRecentTransaction.setText("No Recent
Transactions" );
}
else
{
// for (int x=1;x<=xmlResponse.length;)
{
lblTMSCustomTransactionDate = (TextView)
findViewById(R.id.lblTMSCustomTransactionDate);
lblTMSCustomTransactionDate.setText("Transaction Date :
" + xmlResponse[5][1] );
lblTMSCustomAmount = (TextView)
findViewById(R.id.lblTMSCustomAmount);
lblTMSCustomAmount.setText("Amount : " +
xmlResponse[6][1] );
lblTMSCustomTransactionDate2 = (TextView)
findViewById(R.id.lblTMSCustomTransactionDate2);
lblTMSCustomTransactionDate2.setText("Transaction Date : " + xmlResponse[8][1] );
lblTMSCustomAmount2 = (TextView)
findViewById(R.id.lblTMSCustomAmount2);
lblTMSCustomAmount2.setText("Amount : " +
xmlResponse[9][1] );
lblTMSCustomTransactionDate3 = (TextView)
findViewById(R.id.lblTMSCustomTransactionDate3);
lblTMSCustomTransactionDate3.setText("Transaction Date : " + xmlResponse[11][1] );
lblTMSCustomAmount3 = (TextView)
findViewById(R.id.lblTMSCustomAmount3);
lblTMSCustomAmount3.setText("Amount : " +
xmlResponse[12][1] );
}
}