All pastes #2050381 Raw Edit

Miscellany

public text v1 · immutable
#2050381 ·published 2011-04-25 09:09 UTC
rendered paste body
layout/dialog_edit_group.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/dlgEditGroup"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
    <EditText android:id="@+id/txtGroup"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:hint="Group Name"/>
</LinearLayout>

my activity (onCreateDialog):
                ...
                LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
                View layout = inflater.inflate(R.layout.dialog_edit_group, (ViewGroup) findViewById(R.id.dlgEditGroup));
                EditText txtGroup = (EditText) layout.findViewById(R.id.txtGroup);
                txtGroup.setFocusable(true);
                builder.setTitle("Title")
                        .setView(layout)
                        .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int id) {}
                        })
                        .setNegativeButton("No", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int id) {}
                        });
                return builder.create();