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
Post a Comment