0

If i put

 android:layout_width="wrap_content"  
 android:layout_height="wrap_content"    

for the root element of layout of activity and put a border around it. It works and the border is visible in API 19. Does it work in all apis ? What is the element above root element ?
what does the root element attaches to?

Shreyans jain
  • 559
  • 6
  • 18

1 Answers1

0

In android, there are two types of API or Libraries. For Eg : Lets take example of FragmentManager class. it is Available as SupportFragmentmanager as well. Class SupportFragmentManager will work in all APIs but FragmentManager will work till a limit of API suppose API >= 17 In the same way There are many classes which are available as both ways support as well as normal class.

Compatibily in different API has been a major issue in android. that is why special libraries by google android team has been developer and available for use Eg. support v7, support v4 etc. All the classes contained by these libraries are supported by all APIs.

Now comming to your question :

I don't know which classes have you used to draw a border. Read its documentation. The API level supported by those classes must be their.

height and width are common attributes They will work in all APIs. If not, you get a message on same line that "this attributes is not applicable for API<=17" or similar to this.

vabhi vab
  • 419
  • 4
  • 11