Android Delphi XE7安卓Indy IRC
加入后,通道应用程序将在几秒钟后自行终止。程序运行在真实电话LG L65(无签名),我有一个事件IdIRC1Raw。有什么建议吗Android Delphi XE7安卓Indy IRC,android,delphi,indy,Android,Delphi,Indy,加入后,通道应用程序将在几秒钟后自行终止。程序运行在真实电话LG L65(无签名),我有一个事件IdIRC1Raw。有什么建议吗 procedure THeaderFooterwithNavigation.IdIRC1Raw(ASender: TIdContext; AIn: Boolean; const AMessage: string); begin Memo1.Lines.Add(AMessage) end; 当AIn参数为true时,将在TIdIRC内部运行的工作线程上下文中调用O
procedure THeaderFooterwithNavigation.IdIRC1Raw(ASender: TIdContext; AIn: Boolean; const AMessage: string);
begin
Memo1.Lines.Add(AMessage)
end;
当
AIn
参数为true时,将在TIdIRC
内部运行的工作线程上下文中调用OnRaw
事件处理程序(由AContext
参数表示)。当AIn
为false时,OnRaw
在发送命令的任何线程的上下文中被调用(并且AContext
为nil)
由于OnRaw
并不总是在主UI线程的上下文中运行,因此必须与主UI线程同步,以便安全地更新备忘录,例如:
procedure THeaderFooterwithNavigation.IdIRC1Raw(ASender: TIdContext; AIn: Boolean; const AMessage: string);
begin
TThread.Synchronize(nil,
procedure
begin
Memo1.Lines.Add(AMessage);
end
);
end;
但是,请记住,在XE7之前,尽管有一个简单的解决方法(在上面的链接中提到):
我的建议是停止在android平台上使用delphi。。。logcat中有日志吗?也许indy组件使用了错误的线程我在真实的手机上运行这个apk,没有日志它在模拟器中工作正常吗?我不使用模拟器(太慢的计算机)官方的Android模拟器一般都很慢。使用另一个模拟器,如Bluestack或Genymotion。他们快得多。
procedure THeaderFooterwithNavigation.Timer1Timer(Sender: TObject);
begin
CheckSynchronize;
end;