gpt4 book ai didi

android - 如何实现休眠100毫秒的重试机制

转载 作者:太空狗 更新时间:2023-10-29 16:41:38 26 4
gpt4 key购买 nike

我想在几毫秒后执行这条指令。

我怎样才能做到这一点?

try {
// Get the typeface
MyApp.appTypeFace = Typeface.createFromAsset(getApplication().getAssets(),
MyApp.fontName);
Log.d("font","in try="+MyApp.fontName);
Log.d("font","type face="+MyApp.appTypeFace);
}

最佳答案

Handler handler;

handler=new Handler();
Runnable notification = new Runnable() {
@Override
public void run() {
MyApp.appTypeFace = Typeface.createFromAsset(getApplication().getAssets(),
MyApp.fontName);
Log.d("font","in try="+MyApp.fontName);
Log.d("font","type face="+MyApp.appTypeFace);

}
};
handler.postDelayed(notification,100);

关于android - 如何实现休眠100毫秒的重试机制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16857318/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com