Hello and welcome to the forums.

This is a common newbie mistake.

if(namearray[i]==namesearch)

Needs to be:

if(namearray[i].equals(namesearch))