I'm trying to implement an 'Open on phone' button on a Wear OS app, but am unable to import the RemoteIntent class.
When I add import com.google.android.wearable.intent.RemoteIntent to my MainActivity.java the wearable is underlined in red with a 'Cannot resolve symbol' error.
Do I need to add a particular dependency to my project for this to be available?
The docs for RemoteIntent don't give me any clues as to what I might be missing.
For context, I am trying to use the following snippet in my app:
private void openOnPhone(Uri uri) {
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
RemoteIntent.startRemoteActivity(this, intent, null);
// 'Open on phone' confirmation overlay
new ConfirmationOverlay().setType(ConfirmationOverlay.OPEN_ON_PHONE_ANIMATION).setMessage("Opened on phone").showOn(this);
}