Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you show a webview in the floating window #1

Open
mph070770 opened this issue Feb 23, 2024 · 5 comments
Open

Can you show a webview in the floating window #1

mph070770 opened this issue Feb 23, 2024 · 5 comments

Comments

@mph070770
Copy link

Hi, thanks for the code. I was wondering if it's possible to show a webview in the floating window i.e. specify the URL of a webpage and have the webpage loaded in the floating window, that can then be dragged around the screen?

Thanks!

@la-niina
Copy link
Owner

la-niina commented Feb 23, 2024 via email

@mph070770
Copy link
Author

Wow - amazingly quick reply, thank you! I'll give it a go. I'm new to Android/Kotlin so any tips would be appreciated. Thanks again.

@la-niina
Copy link
Owner

la-niina commented Feb 23, 2024 via email

@mph070770
Copy link
Author

Good luck with your plans - it sounds exciting for you!

There's a few issues with the code. Out of the box, it crashes until you manually enable "display over other apps" in settings. It would be good that the app directs the user there automatically.

Once that option is enabled, I'm hitting another crash:

FATAL EXCEPTION: main
Process: kor.app, PID: 13797
java.lang.RuntimeException: Unable to destroy activity {kor.app/kor.app.MainActivity}: java.lang.IllegalArgumentException: View=kor.app.MyLinearLayout{1c74902 V.E...... ......I. 0,0-0,0} not attached to window manager
	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4383)
	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4401)
	at android.app.ActivityThread.-wrap5(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6494)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalArgumentException: View=kor.app.MyLinearLayout{1c74902 V.E...... ......I. 0,0-0,0} not attached to window manager
	at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:485)
	at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:394)
	at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:124)
	at kor.app.MainActivity.onDestroy(MainActivity.kt:216)
	at android.app.Activity.performDestroy(Activity.java:7218)
	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1249)
	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4370)
	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4401) 
	at android.app.ActivityThread.-wrap5(Unknown Source:0) 
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649) 
	at android.os.Handler.dispatchMessage(Handler.java:106) 
	at android.os.Looper.loop(Looper.java:164) 
	at android.app.ActivityThread.main(ActivityThread.java:6494) 
	at java.lang.reflect.Method.invoke(Native Method) 
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

Not sure what is wrong there, at the moment.

@la-niina
Copy link
Owner

la-niina commented Feb 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants