Reputation: 105
I am opening an activity in watch by clicking a button in mobile using wearable listener service. I can also launch the activity by clicking the app in watch. So I would like to differentiate them - I want to know when the activity was launched from phone so that the activity layout looks slightly different. What is the easiest way to do this? Please advise.
Upvotes: 1
Views: 209
Reputation: 19044
When you start an activity through a WearableListenerService, you are the one who is setting up an intent and call startActivity. As such, you can set a certain boolean "extras" to true on the intent to be passed to the activity and then in the activity, extract that "extras" and based on the value, inflate different layouts; when your activity is started from the list of apps, that boolean "extras" will be false.
Upvotes: 1