I'm getting null from my findViewById call, and I can not figure out why. The code below is relative to Activity
in my program:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.dashboard);
getLayoutInflater().inflate(R.layout.activity_cpc_select, frameLayout);
TreeNode root = TreeNode.root();
TreeNode parent = new TreeNode("MyParentNode");
TreeNode child0 = new TreeNode("ChildNode0");
TreeNode child1 = new TreeNode("ChildNode1");
parent.addChildren(child0, child1);
root.addChild(parent);
AndroidTreeView tView = new AndroidTreeView(this, root);
FrameLayout view= (FrameLayout) findViewById(R.id.cpc_tree_view);
view.addView(tView.getView());
}
My layout is defined like this:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/cpc_tree_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</FrameLayout>