here is the code:
@Override
public void onBindViewHolder(@NonNull final WorkerViewHolder holder, int position) {
final Worker currentWorker = mWorkerList.get(position);
holder.textView_worker_name.setText(currentWorker.getName());//sets each worker in the Recycler
holder.btnWorking.setVisibility(View.INVISIBLE);
Log.d("myappCurrent",currentWorker.getName() + wWorkerList.get(0).getWorkerName());
for(AtWorkWorker worker: wWorkerList){
if(currentWorker.getName() == worker.getWorkerName()){
holder.btnWorking.setText("Working on "+ worker.gettask());
holder.btnWorking.setVisibility(View.VISIBLE);
Log.d("myapp", worker.gettask());
}
} //iterates over wworkerlist(obj array) and matches position var with the corresponding position in AtWorkWorkers list
}
the log.d just before the for loop prints out this:
2020-09-13 15:35:17.307 22092-22092/com.example.sheetmetalroofersaudit D/myappCurrent: TrevorTrevor
2020-09-13 15:35:17.322 22092-22092/com.example.sheetmetalroofersaudit D/myappCurrent: CandaceTrevor
2020-09-13 15:35:17.336 22092-22092/com.example.sheetmetalroofersaudit D/myappCurrent: Kevin soareTrevor
2020-09-13 15:35:17.348 22092-22092/com.example.sheetmetalroofersaudit D/myappCurrent: akins smithTrevor
but the if statement never triggers when Trevor and Trevor line up.
The wWorkerlist comes from sharedpreferences so could there be a delay in getting the values and the if statement is run through before its triggered?