このような問題があります: Android OS を搭載したデバイスで、アクション スクリプト コードを実行しています。そして、サーバーにデータを送信する必要があるメソッドがあります。しかし!!!サーバーにデータを送信する前にアプリケーションを停止しても、何らかの形でそのデータが送信されます。私はそれがどのようにできるのか理解できませんか?? この問題に直面した人はいますか?私を助けてください。ありがとう。
public class VerifyCommand extends SimpleCommand
{
override public function execute(notification:INotification):void
{
//here is the place, where I put breakpoint and stop the program
trace("here is the place, where I put breakpoint and stop the program");
verify();
}
private function verify():void
{
var tempError:Error = new Error();
var stackTrace:String = tempError.getStackTrace();
trace(stackTrace);
var request : URLRequest = new URLRequest();
request.url = "http://www.somesite.com";
request.method = URLRequestMethod.POST;
request.contentType = "application/x-www-form-urlencoded; charset=utf-8";
request.data = variables;
request.useCache = false;
request.cacheResponse = false;
var call_loader:URLLoader = new URLLoader();
call_loader.dataFormat = URLLoaderDataFormat.TEXT;
call_loader.addEventListener(Event.COMPLETE, onVerificationResult);
call_loader.addEventListener(IOErrorEvent.IO_ERROR, onVerificationError);
call_loader.load(request);
}
private function onVerificationResult(event:Event):void
{
trace("all ok");
}
private function onVerificationError( event:Event):void
{
trace("all failed");
}
}