例1:
2
3
4
|
protected
void
onPrepareDialogBuilder(AlertDialog.Builder builder) {
builder =
new
AlertDialog.Builder(
new
ContextThemeWrapper(
this
.getContext(), R.style.ListDlgTheme));
super
.onPrepareDialogBuilder(builder);
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
public
class
ListPreferenceEx
extends
ListPreference
{
Context context1;
View menuView;
public
ListPreferenceEx(Context context, AttributeSet attrs)
{
super
(context, attrs);
context1=context;
}
@Override
protected
void
onPrepareDialogBuilder(AlertDialog.Builder builder)
{
//Builder builder1=new AlertDialog.Builder(new ContextThemeWrapper(context1, R.style.AlertDialogCustom));
//super.onPrepareDialogBuilder(builder); // To change body of overridden
// methods use File | Settings |
// File Templates.
//builder=new AlertDialog.Builder(new ContextThemeWrapper(context1, R.style.AlertDialogCustom));
menuView = View.inflate(context1, R.layout.add_tab,
null
);
/*builder.setNegativeButton(null, null);
builder.setTitle(null);*/
builder.setView(menuView);
}
}
|