我想通过全局对象Task mTask将ID从onItemClick方法传递到editTask方法,但是当我想在mTask.setId(item.getId())上设置ID时;在onItemClick中,我总是得到null ...如果我在以下位置设置ID:ID = item.getId();很好可能是什么问题,或者您可能知道在ViewModel中的方法之间传递数据的更好解决方案?
ViewModel:
string firstSt = first.ToString();
string secondSt = second.ToString();
// contains unless we find a counter example
bool contains = true;
for (int i = 0; i < firstSt.Length; ++i) {
char toFind = firstSt[i];
bool found = false;
for (int j = 0; j < secondSt.Length; ++j) {
if (toFind = secondSt[j]) {
found = true;
break;
}
}
// firstSt[i] is not found within secondSt
if (!found) {
contains = false;
break;
}
}