public boolean isTablet(Context context)
{
return (context.getResources(). getConfiguration(). screenLayout
{
return (context.getResources().
& Configuration.SCREENLAYOUT_SIZE_MASK ) >=
Configuration.SCREENLAYOUT_ SIZE_LARGE;
}
Configuration.SCREENLAYOUT_
}
then i changed the design layout based on the device type that was returned from the method isTablet(); with this code:
boolean tablet = isTablet(this)
if (tablet)
setContentView(R.layout.tablet_design);if (tablet)
else
setContentView(R.layout.phone_design);
0 comments :
Post a Comment