How to pass values from a Class to Activity - Android

前端 未结 6 1263
误落风尘
误落风尘 2021-02-09 08:23

I have a newbie question about Class/Task/Activity. I\'m coming from C so I don\'t know if it\'s a good approach to do what I need.

I\'ve created a class:



        
6条回答
  •  借酒劲吻你
    2021-02-09 08:49

    Maybe you could use a Handler, load it with some data, and then read those data from your activity. Check more infos here about handlers

    You'd just pass an handler from your activity to your class, use handler.sendMessage("") inside your run method, and analyse what you receive inside your activity.

提交回复
热议问题