I have the following layout files:
activity_main.xml
Go into this file res/values/dimens.xml
and change the values to 0dp just like in the code below.
<dimen name="activity_horizontal_margin">0dp</dimen>
<dimen name="activity_vertical_margin">0dp</dimen>
I know this is already answered question but, i just come across such an issue, the answer helped but not completely, as there was a right padding. I found out that, it is because of the padding set in the Theme i used. It might be helpful for those still see the padding. All you need to do is remove it.