I need a custom dialog, very similar to the one showed for authorizing USB DEBUG. I'm on API LEVEL 15 and above.
 Basically I need to put a checkbox with a text in the custom view. I tried:
Basically I need to put a checkbox with a text in the custom view. I tried:
LayoutInflater inflater = getActivity().getLayoutInflater();
builder.setView(inflater.inflate(R.layout.my_dialog, (ViewGroup) getActivity().findViewById(R.id.root_of_my_dialog)));
And my custom view is:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root_of_my_dialog"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <!-- Here I'll have the checkbox -->
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Test"
        android:textColor="@color/red" />
</LinearLayout>
This way my custom layout is not getting the right margin/padding (the word test is just on the extreme left)...it's just like not having any style. How can I inherit from the standard/default one?
 
     
     
    