You'll have to put that line into the OnItemSelectedListener
as well:
sbid.setText(scrapBookId);
As you do it now, you are displaying the id in your TextView
before the user has selected anything, so you will of course see the value you initialized scrapBooxId
with.