Quiet simply, I am trying to reuse my Adapters and Activity classes. When I call the Intent to open my Activity, I pass name of the Layout I want to inflate as a StringExtra like this:
i.putExtra("layout_name", "layout_a");
Then inside my Activity I obtain the extra:
Intent i = getIntent();
String layout_name = i.getStringExtra("layout_name");
Now I want to use this in this format:
setContentView(R.layout. + layout_name);
Is something like this possible? What's the correct syntax?