java - using same thread variable in different functions -



java - using same thread variable in different functions -

i have java lib specific printer , write printer need run in thread, have different function in printer class, 1 align text 1 print barcode, etc... able print have port printer , utilize port different functions. here code:

port = starioport.getport(portname,portsettings, 10000,null);

in diffrent functions utilize port this:

try { starprinterstatus status = null; status = port.begincheckedblock(); port.writeport(text,0,text.length); status = port.endcheckedblock(); grab (starioportexception e) { }

and when finish print job.

if(port != null){ seek { starioport.releaseport(port); } grab (starioportexception e) {} }

how can create thread , utilize same "port" in functions?

java android multithreading printing

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -