当用户单击按钮时,我使用以下代码以ok按钮显示"Hello"消息.在某些应用程序中,这工作正常.即,在单击"确定"按钮时,活动将被取消.但在一个应用程序中,单击确定按钮后不会被解雇.该怎么办?请帮忙.
public class MyClass extends Activity {
private TextView labelTxt;
private Button okBtn;
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.message);
labelTxt = (TextView) findViewById(R.id.txt);
labelTxt.setText("Hello");
okBtn = (Button) findViewById(R.id.okBtn);
okBtn.setOnClickListener(okBtnClickListener);
}
private final OnClickListener okBtnClickListener = new OnClickListener() {
public void onClick(View v) {
finish();
}
};
}
Run Code Online (Sandbox Code Playgroud) 我的配置是尝试获取一个xml文件(下面的内容).我使用VFS参数编写了一个代理服务(可在下面找到).但是我在执行期间遇到这些错误.该文件未从该位置获取.
错误信息:
[2014-07-11 20:30:28,878] ERROR - VFSTransportListener Error processing File URI : file:///C:/wso2VFS/wso2Input/order_in.xml
org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found Orderdetail
输入XML文件(Order_in.txt)
<?xml version="1.0" encoding="UTF-8"?>
<Orderdetail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation='C:\wso2VFS\wso2Input\order_input.xsd'>
<Order>
<orderid>20000</orderid>
<itemname>Apple iphone</itemname>
<storenumber>6932</storenumber>
<address>Mooresville</address>
<zipcode>28117</zipcode>
<ordertotal>6712</ordertotal>
</Order>
</Orderdetail>
Run Code Online (Sandbox Code Playgroud)