Re: [android-developers] Different resources, one xml file?

2011-06-29 Thread Justin Anderson
I achieved something similar by subclassing a layout (in my case it was RelativeLayout) and specifying custom XML attributes. Then when I used it in my xml files I just specified that I wanted my custom layout view and specified my custom attributes to make them slightly different (i.e. different

Re: [android-developers] Different resources, one xml file?

2011-06-27 Thread Kumar Bibek
Set the values through code *Thanks and Regards, Kumar Bibek* * http://techdroid.kbeanie.com http://www.kbeanie.com* On Mon, Jun 27, 2011 at 2:26 PM, muckwarrior wrote: > I'm building an app, similar to a quiz app, which repeats > functionality for different subjects. The layouts will be the

[android-developers] Different resources, one xml file?

2011-06-27 Thread muckwarrior
I'm building an app, similar to a quiz app, which repeats functionality for different subjects. The layouts will be the same for each subject except that the resources used will different, e.g. Subject 1 will use ButtonImage 1 and Background colour 1, Subject 2 uses ButtonImage 2 etc. etc. What I'

Re: [android-developers] Different resources, one xml file?

2011-06-26 Thread TreKing
On Fri, Jun 24, 2011 at 4:00 AM, muckwarrior wrote: > Is there an easy way to do this without duplicating code? protected void onCreate(Bundle bundle) { setContentView(R.layout.my_single_layout); setCustomButtonImageBasedOnSubject(); setCustomBackgroundImageBasedOnSubject(); } Now implement

[android-developers] Different resources, one xml file?

2011-06-26 Thread muckwarrior
I'm building an app, similar to a quiz app, where layouts and functionality will be duplicated across a number of subjects. The activities and layouts will be identical for each subject, the only difference should be the resources used, e.g. Subject 1 uses button image 1 and background 1, Subject 2