CopyPastor

Detecting plagiarism made easy.

Score: 0.8017717003822327; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2014-02-10
by Nayan Rath

Original Post

Original - Posted on 2012-02-16
by ol\_v\_er



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Go For this Link :
[Developer Android][1]

<resources> <bool name="isTablet">true</bool> </resources>
Because the sw600dp qualifier is only valid for platforms above android 3.2. If you want to make sure this technique works on all platforms (before 3.2), create the same file in res/values-xlarge folder:

<resources> <bool name="isTablet">true</bool> </resources>
Then, in the "standard" value file (as res/values/), you set the boolean to false:
<resources> <bool name="isTablet">false</bool> </resources>
Then in you activity, you can get this value and check if you are running in a tablet size device:
boolean tabletSize = getResources().getBoolean(R.bool.isTablet); if (tabletSize) { // do something } else { // do something else }
Please check and let me know.Hope it should helpful for you. Thanks.
[1]: http://developer.android.com/training/multiscreen/screensizes.html#TaskUseSWQuali
This subject is discussed in the Android Training:
[Use the Smallest-width Qualifier][1]
If you read the entire topic, they explain how to set a boolean value in a specific value file (as res/values-sw600dp/attrs.xml):
<resources> <bool name="isTablet">true</bool> </resources>

Because the sw600dp qualifier is only valid for platforms above android 3.2. If you want to make sure this technique works on all platforms (before 3.2), create the same file in res/values-xlarge folder:
<resources> <bool name="isTablet">true</bool> </resources>
Then, in the "standard" value file (as res/values/attrs.xml), you set the boolean to false:
<resources> <bool name="isTablet">false</bool> </resources>
Then in you activity, you can get this value and check if you are running in a tablet size device:
boolean tabletSize = getResources().getBoolean(R.bool.isTablet); if (tabletSize) { // do something } else { // do something else }

[1]: https://developer.android.com/training/multiscreen/screensizes.html#TaskUseSWQuali

        
Present in both answers; Present only in the new answer; Present only in the old answer;