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);

```
**Convert dp to pixel:**

```
public int dpToPx(int dp) {
    DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
    int px = Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));       
    return px;
}

```

**Convert pixel to dp:**

```
public int pxToDp(int px) {
    DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
    int dp = Math.round(px / (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));
    return dp;
}

```