pingpongboss / StandOut

StandOut lets you easily create floating windows in your Android app.
http://pingpongboss.github.com/StandOut
MIT License
1.24k stars 379 forks source link

Preferred way of getting Activity or Context from StandOutWindow? #23

Closed gw0 closed 9 years ago

gw0 commented 10 years ago

I am wondering what is the preferred way of getting the current Activity or Context object into StandOutWindow? Or the other way around, how to access the FrameView of StandOutWindow from the Activity?

Or did I do something wrong and there exists a development pattern that doesn't get you in such troubles?

pingpongboss commented 10 years ago

The StandOutWindow exists in a Service, not an Activity. If you need a Context, you can use "this" while inside of StandOutWindow or your own subclass.

From the Activity, you can't directly access the StandOut windows. You'll want to use the #sendData pattern https://github.com/pingpongboss/StandOut/blob/master/library/src/wei/mark/standout/StandOutWindow.java#L205

On Tue Sep 16 2014 at 1:17:30 AM gw0 notifications@github.com wrote:

I am wondering what is the preferred way of getting the current Activity or Context object into StandOutWindow? Or the other way around, how to access the FrameView of StandOutWindow from the Activity?

Or did I do something wrong and there exists a development pattern that doesn't get you in such troubles?

Reply to this email directly or view it on GitHub https://github.com/pingpongboss/StandOut/issues/23.

gw0 commented 9 years ago

Thank you.