We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CheckBox checkBox; LayoutInflater inflater; View floatView; inflater = getLayoutInflater(); floatView = inflater.inflate(R.layout.float_window, null); Log.d(TAG, "initView: "+floatView.findViewById(R.id.checkBox)); checkBox = floatView.findViewById(R.id.checkBox); if (checkBox != null) { // 如果 checkBox 不为空,表示成功找到了对应 ID 的 CheckBox Log.d(TAG, "CheckBox found with ID: " + checkBox.getId()); } else { // 如果 checkBox 为空,表示找不到对应 ID 的 CheckBox Log.e(TAG, "CheckBox not found with ID: R.id.checkBox"); } checkBox.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d(TAG, "initView: "+R.id.checkBox); Log.d(TAG, "onClick: "); } });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: