如何从新项目中删除kotlin支持并仅使用java支持而不创建新项目?
我想用蓝牙发送一个字符。当只有一个字符时,代码运行良好。但我想在两个代码之间使用延迟函数。我想用 EditText 输入任何数字,应用程序将采用该数字并执行 EditText/44。这就是我想在 2 个代码之间等待的
终于工作了..谢谢大家。:)
我在 setOnClick.. 中移动了 a,b,c
kileri = (Button) findViewById(R.id.kileri);
final EditText value1 = (EditText) findViewById(R.id.textkont);
assert value1 != null;
value1.setText("0");
btAdapter = BluetoothAdapter.getDefaultAdapter();
checkBTState();
kileri.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
int a = Integer.parseInt(value1.getText().toString());
int b = a / 44;
int c = b * 1000;
sendData("F");
try {
Thread.sleep(c);
} catch (Exception e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud) 我突然无法在 Unbuntu 服务器上发送电子邮件。
从今天起就发生了。它仍然在本地工作。
javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1907)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:666)
Run Code Online (Sandbox Code Playgroud)
JAVA:
openjdk 版本“11.0.11” 2021-04-20
OpenJDK 运行时环境(构建 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64 位服务器 VM(构建 11.0.11+9-Ubuntu-0ubuntu2.20.04 、混合模式、共享)
握手后新会话票证到达:
SSL 会话:
协议:TLSv1.3
密码:TLS_AES_256_GCM_SHA384
下面的代码显示了我目前的实现,这里正在创建一个 toast 对象并在 onPause() 中关闭。这工作正常,直到没有敬酒队列。
public static long **savedTimeStamp=0**;
Toast showToastMessage;
if(System.currentTimeMillis()/1000 - savedTimeStamp >= 60 || savedTimeStamp==0){
showToastMessage=Toast.makeText(this.this, "Toast message", Toast.LENGTH_LONG);
showToastMessage.show();
savedTimeStamp=System.currentTimeMillis()/1000;
}
@Override
protected void onPause() {
super.onPause();
if(showToastMessage!=null)
{
showToastMessage.cancel();
}
}
Run Code Online (Sandbox Code Playgroud) 我尝试了很多数字,但是它的运行时间像O(1)一样。为什么这么快?有人可以解释一下**运算符的实际工作原理。