Question: I have one submit button, on click of which normal submission of a form should work.
I have another element, a check box on click of which I need to submit the form.
Is it possible?
If yes, how?

Answer: 
You're doing the right thing it's just your conversion is wrong, it should be something like this:

```
float scale = context.getResources().getDisplayMetrics().density;
x = Math.round(80 * scale);
... new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, x);

```
Pixel to Dp converter

```
public static float pxToDp(float px) {
        float densityDpi = Resources.getSystem().getDisplayMetrics().densityDpi;
        return px / (densityDpi / 160f);
    }

```

Dp to Pixel converter

```
 public static int dpToPx(int dp) {
        float density = Resources.getSystem().getDisplayMetrics().density;
        return Math.round(dp * density);
    }

```