Tuesday, April 9, 2013

[android help] Combining Multiple Views in Android

application - Combining Multiple Views in Android - Stack Overflow




















In my onCreate for my android app I have:



drawView = new DrawView(this);
View view1 = findViewById(R.id.rel_layout);
ViewGroup BiggerView = new LinearLayout(this);
BiggerView.addView((View) drawView);
BiggerView.addView(view1);
setContentView(BiggerView);


I'm getting a null pointer exception. Why is that? All I am trying to do here is to combine two views (into BiggerView) by adding them each to BiggerView, so I can pass the view to setContentView. Any ideas?



















Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.










default







.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...