-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Description
just a minor issue but I got the following logcat message while running on a raspberry pi 3
com.example.androidthings.gattserver I/Choreographer: Skipped 86 frames! The application may be doing too much work on its main thread.
wouldn't it be better to move the UI code mLocalTimeView.setText(displayDate); to another thread e.g. a runnable inside a runOnUiThread?
e.g.
private void updateLocalUi(long timestamp) {
Date date = new Date(timestamp);
final String displayDate = DateFormat.getMediumDateFormat(this).format(date)
+ "\n"
+ DateFormat.getTimeFormat(this).format(date);
runOnUiThread(new Runnable() {
@Override
public void run() {
mLocalTimeView.setText(displayDate);
}
});
}
Metadata
Metadata
Assignees
Labels
No labels