Now, let's take a closer look at the main pieces of the app by digging into the source code. Follow the given steps to open the app's code in Android Studio:
- From the
Project
window, find and double-click on theHelloArActivity
, as shown:
HelloArActivity shown in the Project window
- After the source is loaded, scroll through the code to the following section:
private void showLoadingMessage() {
runOnUiThread(new Runnable() {
@Override
public void run() {
mLoadingMessageSnackbar = Snackbar.make(
HelloArActivity.this.findViewById(android.R.id.content),
"Searching for surfaces...",
Snackbar.LENGTH_INDEFINITE);
mLoadingMessageSnackbar.getView().setBackgroundColor(0xbf323232);
mLoadingMessageSnackbar.show();
}
});
}
- Note the highlighted text—
"Searching for surfaces.."
. Select this text and change it to"Searching for ARCore surfaces.."
. TheshowLoadingMessage
function is a helper for displaying the loading message. Internally, this function callsrunOnUIThread...