java - How do I import an Android Wear activity class into a mobile activity class? -



java - How do I import an Android Wear activity class into a mobile activity class? -

i used android studio autogenerate android wear project, includes mobile folder code runs on phone, , wear folder code runs on watch. both folders contain same bundle name hierarchy.

in mobile part of project, have activity called src/main/java/mypackage/mobileactivity.java. in wear part of project, there activity called src/main/java/mypackage/wearactivity.java.

my problem is, when seek create wearable action on mobile side (according these instructions), can't access wearactivity class in mobileactivity.java:

intent actionintent = new intent(this, wearactivity.class); pendingintent actionpendingintent = pendingintent.getactivity(this, 0, actionintent, pendingintent.flag_update_current); notificationcompat.action wearableaction = new notificationcompat.action.builder(r.drawable.ic_launcher, getstring(r.string.label_show_details), actionpendingintent).build(); new wearableextender().addaction(wearableaction))

(error: cannot find symbol class wearactivity)

so question is, how should import wearactivity wear side of project, mobile side of project, can refer in intent i'm creating?

the solution not reference wearactivity in mobile app @ all, instead utilize com.google.android.gms.wearable.messageapi send message mobile app wear app. wear app can locally launch own notification includes wearactivity action.

this documented in https://developer.android.com/training/wearables/data-layer/messages.html.

java android android-wear

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -