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

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

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -