¿Qué significa getActivity ()?
Que hacegetActivity()
¿media? Vi en algún lugar, escribieronMainActivity.this.startActionMode(mActionModeCallback)
en lugar degetActivity()
. ¿Podría alguien explicar lo que significan estas dos líneas?
someView.setOnLongClickListener(new View.OnLongClickListener() {
// Called when the user long-clicks on someView
public boolean onLongClick(View view) {
if (mActionMode != null) {
return false;
}
// Start the CAB using the ActionMode.Callback defined above
mActionMode = getActivity().startActionMode(mActionModeCallback);
view.setSelected(true);
return true;
}
});