androidwear-osmodeambient

Ambient Mode not entered with 2D Picker


If my activity implements a 2D Picker, the ambient mode is not entered at all and the activity just stays active the hole time. My other activities implementing a WearableListView don't have that problem, so i assume my code is correct. I am calling setAmbientEnabled at onCreate and have implemented onEnterAmbient/onExitAmbient. Does someone have/had the same experience? Is there a workaround?

@Override
public void onEnterAmbient(Bundle ambientDetails) {
    super.onEnterAmbient(ambientDetails);
    Log.d("Ambient", "active");
    ambientView.setVisibility(View.VISIBLE);
}

@Override
public void onExitAmbient() {
    super.onExitAmbient();
    Log.d("Ambient", "not active");
    ambientView.setVisibility(View.GONE);
}

Solution

  • I presume you are using GridViewPager from the Wearable Support Library. Since I don't have your code, I can't be sure how you are setting things up but I did modify our GridViewPager sample project on GitHub and added Always-on required code and it did work. One thing for you to check is that you do not have android:keepScreenOn="true" in your GridViewPager or somewhere else in your activity layout (the GridViewPager sample has that) and also make sure you are not doing the same (i.e. keeping the screen on) from your Activity.