Android BlutoothChat, making class instance available across other activities -
i'm messing around 1 of android samples bluetooth chat, im relatively new android i'm here users opinions, in main activity class , instance of class "bluetoothchatservice mchatservice" created controlling of bluetooth connectivity, have created new activity launches page of buttons, these buttons send hardcoded messages depending on 1 pressed, aseen "mchatservice" has been initiated , handling connection make class instance available in newly created activity can send messages straight away,
what best practices make available?, have read serializing class (which wont work in instance) can pass in intent, , singletons?
can advice way should done?
thanks!
if can't make class serializable use parcelable , intent.putextra() when sending , intent.getextras().getparelable() on receiving end.
passing reference bluetooth class might tricky. better handling message sending in original activity.
Comments
Post a Comment