Custom value change listener in android? -


need or advice. aim continuous updates method android.telephony.cellsignalstrengthwcdma.getdbm() (get mobile network signal strength dbm) , make update of correspondent text view when value provided method changes.

the first approach of solution request value in do-while cycle predefined time interval, 1 second, check difference between common , previous values , make decision of textview update.

so question maybe there other better way this, using kind of system listener etc?

br,

you need add phonestatelistener telephonymanager using proper method listen(). need pass sub class of phonestatelistener , event want get. example can listen phonestatelistener.listen_cell_info; in case method oncellinfochanged (list cellinfo) of phonestatelistener called, providing info need, avoiding loop.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

javascript - Using jquery append to add option values into a select element not working -