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

SearchWidget is not properly working. #4059

Open
MohitMaliFtechiz opened this issue Nov 6, 2024 · 3 comments · May be fixed by #4062
Open

SearchWidget is not properly working. #4059

MohitMaliFtechiz opened this issue Nov 6, 2024 · 3 comments · May be fixed by #4062
Assignees
Labels
Milestone

Comments

@MohitMaliFtechiz
Copy link
Collaborator

Describe the bug
The SearchWidget is not properly working, it is not opening the bookmark, or search screens.

Expected behavior
It should properly work.

Steps to reproduce the behavior:

  1. Install kiwix app.
  2. Go to the home screen of your device, long press on the screen, and click on the widget(may be different according to your device).
  3. Select the "Kiwix widget".
  4. Click on the buttons in the "Kiwix widget", and you will see the error.

Environment

  • Version of Kiwix Android : 3.11.1
  • Device : Samsung Galaxy A20s
  • OS version : Android 12
XRecorder_06112024_184738.mp4
@MohitMaliFtechiz MohitMaliFtechiz added this to the 3.12.0 milestone Nov 6, 2024
@MohitMaliFtechiz MohitMaliFtechiz self-assigned this Nov 6, 2024
@kelson42
Copy link
Collaborator

kelson42 commented Nov 6, 2024

@MohitMaliFtechiz Please write an automated test for this, hard to understand how we have broken this without noticing.

@Akshaykomar890
Copy link

Akshaykomar890 commented Nov 6, 2024

@kelson42 I have tested it on my device, and I didn’t find any issues.
Version of Kiwix Android : 3.11.1
Device : Poco X2
OS version : Android 11

@MohitMaliFtechiz
Copy link
Collaborator Author

@kelson42 This regression was introduced here bfff033#diff-95ab9c8997fad17d41e271fd21ef5ff42f13f5f9b7480a5b93c34f12e27a76e7R38, the error is ClassCastException it is not properly casting the KClass to CoreMainActivity, and due to this, searchWidget always returning the MAIN action instead of our custom actions.

FATAL EXCEPTION: main
                                                                                                    Process: org.kiwix.kiwixmobile, PID: 7403
                                                                                                    java.lang.RuntimeException: Unable to start receiver org.kiwix.kiwixmobile.main.KiwixSearchWidget: java.lang.ClassCastException: kotlin.jvm.internal.ClassReference cannot be cast to org.kiwix.kiwixmobile.core.main.CoreMainActivity
                                                                                                    	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4506)
                                                                                                    	at android.app.ActivityThread.access$1600(ActivityThread.java:301)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2188)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loop(Looper.java:246)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8653)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
                                                                                                    Caused by: java.lang.ClassCastException: kotlin.jvm.internal.ClassReference cannot be cast to org.kiwix.kiwixmobile.core.main.CoreMainActivity
                                                                                                    	at org.kiwix.kiwixmobile.core.main.CoreSearchWidget.onUpdate(CoreSearchWidget.kt:38)
                                                                                                    	at android.appwidget.AppWidgetProvider.onReceive(AppWidgetProvider.java:66)
                                                                                                    	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4497)
                                                                                                    	at android.app.ActivityThread.access$1600(ActivityThread.java:301) 
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2188) 
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                    	at android.os.Looper.loop(Looper.java:246) 
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8653) 
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) 
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130

@kelson42 I have tested it on my device, and I didn’t find any issues.
Version of Kiwix Android : 3.11.1
Device : Poco X2
OS version : Android 11

Please remove the widget from your home screen, and add it again to home screen, you will see the error.

@MohitMaliFtechiz MohitMaliFtechiz linked a pull request Nov 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants