私はこのようなWearableActivityを拡張するので、私は私のAndroid WearアプリにAPPCOMPAT白黒モードのテーマを使用しようとしているが、それは働いていない、私の活動は、周囲のモードが必要になります。Android Wearの白黒モードのテーマAPPCOMPAT
public class BaseActivity extends WearableActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setAmbientEnabled();
....
}
}
私のテーマについてI以下のようなものがあります。
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@color/colorBackground</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorPrimary">@color/textColorPrimary</item>
</style>
しかし、何も作業していない、テーマは全く変わりません...私は自分のモバイルアプリケーションで同じテーマを使用し、それが動作し、唯一の違いは、私の活動がAppCompatActivityを拡張することです。
Android Wearアプリケーションで動作させる方法はありますか?
でしたを使用することができますウェアラブルデバイスでアプリを実行したときにアプリで何が起こるかを共有しますか?あなたのコンソールに表示されるエラー?または、この[チュートリアル](https://medium.com/@chrisbanes/appcompat-v23-2-daynight-d10f90c83e94)で説明したように 'AppCompatDelegate.setDefaultNightMode()'を試してみて、それがうまくいくかどうか確認してくださいあなたのために。さらに詳しい情報を得るには、[このブログ](https://android-developers.googleblog.com/2016/02/android-support-library-232.html)もご覧ください。 – Teyam
デバイスを実行するときに何も追加するものはありません。これは、setDefaultNightModeを使用して夜を強制する場合でも、「AppCompatActivity」のソースコードを見て、必要に応じて適切なテーマを適用するためのコードを表示します。そのコードをWearableActivityにコピー/ペーストしてみましょう – jaumard