Share class between widget and activity in android
I'll try to explain my idea: I have 1 widget with all his things(xml layout,widget provider...) Widget consists in one ImageView that updates every 24h. Also if user press on widget, it launch an activity. I want to have one class Counter.java that could be accessed from widget and from activity at same time. But I don't want to initialize that class each time I access on it. Just once to create. I dont' know when do it and where.
One more question:
How to detect the moment when Activity is started from widget. And when it comes back to 开发者_如何学编程widget?
精彩评论