Hello I have the following code :
view.setOnLongClickListener((viewL) -> {
final CharSequence[] optionsDialog = {"Edit", "Delete"};
((MainActivity) context).myDialog.setSingleChoiceItems(optionsDialog, 0,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if(i==0){
final Intent myIntent = new Intent (context, MainInputActivity.class);
myIntent.putExtra("request", 8);
myIntent.putExtra("oldTask", mySubTask.getSubTaskText());
myIntent.putExtra("taskCode", mySubTask.getSubtaskCode());
((MainActivity) context).startActivityForResult(myIntent, 8);
dialogInterface.dismiss();
}
if(i==1){
realm.executeTransaction((realm) -> mySubTask.deleteSubtask());
realm.refresh();
notifyDataSetChanged();
((MainActivity) context).updateWidgets();
dialogInterface.dismiss();
}
}
});
So here I have one SAM expression, and inside I want to write the ((MainActivity) context).myDialog.setSingleChoiceItems as lambda too. The problem is that setSingleChoiceItems have 3 parameters and I don't know how am I supposed to convert the snippet into lambda. Is it even possible ? According to my IDE it is, thats why I ask this question.