I'm working on an app where I want the logo left justified and then a list of categories on the right side. So what I have is the logo in an image view which is in the Linear Layout and then I add a ListView to the LinearLayout too so they can be on the same activity. When I try to run it, I get a stopped unexpectedly error.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Commands.setText("Commands");
LinearLayout LL = new LinearLayout(this);
ImageView Logo = (ImageView)findViewById(0x7f020000);
Logo.setImageDrawable(getResources().getDrawable(android.R.drawable.ic_menu_myplaces));
ListView Cats = new ListView(this);
String Categories[] = new String[3];
Categories[0] = "Hardware";
Categories[1] = "Language";
Categories[2] = "Libraries";
ArrayAdapter<String> list = new ArrayAdapter<String>(this, 0, 2, Categories);
Cats.setAdapter(list);
LL.addView(Logo);
LL.addView(Cats);
setContentView(LL);
}
Any help, I'm really confused