Sure enough, the answer was staring me in the face. I never created an android:id
and was referencing a layout instead of an ID. In fact, looking back, I used R.layout
. Should have been blatantly obvious I wasn't gonna get an ID returned. Assigning an ID in XML, REFERENCING that ID with the correct R.id
, and setting the content prior to declaring, fixed and execute perfectly, after a clean.
CODE:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
RelativeLayout layout = (RelativeLayout) findViewById(R.id.pooper);
LinearLayout layoutchild = new LinearLayout(this);
TextView test = new TextView(this);
test.setText("DebuggedTheHeckOuttaThis");
layoutchild.addView(test);
layout.addView(layoutchild);
}