我正在编写一个 Android Wear(手表)应用来补充平板电脑/手机应用。
调试(或运行应用程序)时不会调用 onCreateView。
是否有不同的执行顺序或方法名称而不是需要与 Android Wear 一起使用的 onCreateView?
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.activity_wear_ref_scorecard, container, false);
Intent getMatchID = getIntent();
String message = getMatchID.getStringExtra(MainActivity.match_id);
//Disable score buttons
Button homeFoulsBtnDisabled = (Button) findViewById(R.id.btn_HomeScore);
Button awayFoulsBtnDisabled = (Button) findViewById(R.id.btn_AwayScore);
Button homeGoalsBtnDisabled = (Button) findViewById(R.id.btn_HomeFoul);
Button awayGoalsBtnDisabled = (Button) findViewById(R.id.btn_AwayFoul);
homeFoulsBtnDisabled.setEnabled(false);
awayFoulsBtnDisabled.setEnabled(false);
homeGoalsBtnDisabled.setEnabled(false);
虽然我的按钮 onClicks 工作正常;
final Button awayScoreBtn = (Button) findViewById(R.id.btn_AwayScore);
awayScoreBtn.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
....