这是我的项目 XML 布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/flowLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- enter code here -->
</LinearLayout>
我需要在JAVA 文件中访问它,该文件应包含 3 个文本视图中的 3 个句子...
public class MainActivity extends Activity {
private View layout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById();
//enter code here
}
private void findViewById() {
View layout = findViewById(R.id.flowLayout);
//enter code here
}
}