I am developing an wear app, i want the app icon to be display on top of window above the watch face. I have tried using WindowManager but failed to get the result.
WindowManager.LayoutParams params=new WindowManager.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_PHONE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
params.gravity= Gravity.CENTER|Gravity.CENTER; params.x=160; params.y=160; windowManager=(WindowManager)getSystemService(WINDOW_SERVICE); windowManager.addView(mfloatview,params);
my question is it possible to add an floating app icon in android wear?
Asked
Active
Viewed 151 times
1

Karthik
- 87
- 1
- 9
2 Answers
0
I'm not sure if this feature (Display app icon on top of all window) is available. But you can try checking the documentation - Watch Face Complications.
A complication is any feature in a watch face that displays more than hours and minutes. For example, a battery indicator is a complication. The Complications API is for both watch faces and data provider apps.
Just like this:
Since you are using Android Wear 2.0, Complication API will be available for use.
Hope this helps.
-
Thank you Mr.Rebot, i tried this one and it works for wear also... http://www.androidhive.info/2016/11/android-floating-widget-like-facebook-chat-head/ – Karthik Apr 24 '17 at 12:37
0
I tried this one and works for android wear also... apply same concept to wear, it works http://www.androidhive.info/2016/11/android-floating-widget-like-facebook-chat-head/

Karthik
- 87
- 1
- 9