The following code shows me the following error:
"Fragments should be static such that they can be re-instantiated by the system, and anonymous classes are not static"
How can I fix it?
public void A(){
final DialogFragment dialogFragment =
new DialogFragment() {
@Override
public Dialog onCreateDialog(Bundle bundle) {
AlertDialog.Builder builder =
new AlertDialog.Builder(getActivity());
builder.setMessage("Hello");
builder.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
B();
}
}
);
return builder.create();
}
};
}
private void B() {
//...
}
DialogFragment
Fragment ? – ρяσѕρєя K Dec 21 '16 at 10:33