I don´t have so many experiences with fragments at the moment so i hope anybody can help me with this ! Before the app release compiled fine some month ago and now i have this problem
Android Studio says: "Problem avoid not default constructors in fragments. "
I hope anybody can help me here to solve this problem.
public static class TagClickDialog extends DialogFragment {
private final TagClickDialogListener mListener;
private final Context mContext;
private final Tag[] mTags;
public TagClickDialog(Context context, TagClickDialogListener listener, Tag[] tags) {
mListener = listener;
mContext = context;
mTags = tags;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
String[] dialogItems = new String[mTags.length];
for (int i=0; i<mTags.length; i++) {
dialogItems[i] = mTags[i].getValue();
}
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setTitle(getResources().getString(R.string.tags))
.setItems(dialogItems, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
mListener.onTagClick(mTags[which]);
}
});
return builder.create();
}
}