モバイル(minSdkVersion = 9)とウェア(minSdkVersion = 20)モジュールの両方で新規プロジェクトを作成しました。 -square(私はWatchViewStubクラスで少し遊んでいますか?)デバイス。同様に、私はデータがハンドヘルドからウェアに送信されることを知っていますが、アプリをwear-roundとwear-squareレイアウト(特にXMLファイルのみを使用)で実行するように設定するにはどうすればよいですか?ここでモバイルとウェアモジュールのレイアウトを指定する
が私の携帯\ ... \ activity_main.xmlです:摩耗モジュールの下のレイアウトについては
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Hello mobile world!"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
、すべてが(私は何も変更しなかった)デフォルトし、そのためには含まれていないが、 WatchViewStubクラスのインプリメンテーションを通じてインフレータに限定され、丸スクエアスクリーンのXMLは「Hello Square World!」を出力するはずです。それぞれ「ハロー!世界一周」、およびなど
は、ここに私の手つかずの摩耗\だ... \ MainActivity:
package dpark.gameoflife;
import android.app.Activity;
import android.os.Bundle;
import android.support.wearable.view.WatchViewStub;
import android.widget.TextView;
public class MainActivity extends Activity {
private TextView mTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub stub) {
mTextView = (TextView) stub.findViewById(R.id.text);
}
});
}
}
...そしてここで私は、摩耗仮想エミュレータから何を得るのです。
なぜ丸い仮想エミュレータ上では、ラウンドを表示されませんか?
おかげで、私は非常に感謝します。
ありがとうございます! :) – DaveNOTDavid