Differentiate tablet with phone in manifest
Is it possible to differentiate tablet with a phone in manifest: I would
like to say if tablet open tablet.class Java file or else open phone.class
as the main screen.
I know I can do a setcontentview according to the tablet or phone but the
problem is that the layout names and other things are different in both
phone and tablet.
For example:
TabletActivity.xml
Layout 1 and Layout 2 with two buttons.
But for PhoneActivity.xml
Layout 1, Layout 2, Layout 3, Layout 4 with 4 buttons.
So If I use same JAVA file - I will end up having long code with
conditions - instead if I could differentiate this in the beginning like
If tablet just open tablet.class if not open phone.class - It would be
easier for me?
AGAIN: I am able to differentiate tablet with phone in my
mainactivity.java file. I try ing to know will I be able to do it in
manifest reason because I have 20 different theme so I have 20 different
xml file for tablet and phone and one java file (right now, Oncreate of my
mainactivity - before setcontent I am checking if phone or tablet and then
theme value and setting the content accordingly). I am wondering is there
any easier way than this method???
Or shall I use two different APK's that works only for phone or tablet?
Is this possible?
Let me know!
Thanks!
No comments:
Post a Comment