Android Question Widget created with B4A6.5 Locked, with Android 7 [SOLVED]

Star-Dust

Expert
Licensed User
Longtime User
I realized a year ago an App with a Widget.
Clicking on the App opens the Main activity, but by clicking on the Widget another activity is opened.

I usually try my apps on different physical devices, with Adroid 4, 4.2, 4.4, 5.0, 6.0, 7.0. Both Smartphone and tablet.

This App I had not yet tried on Android 7. Today trying it on dispositiv with adroid 7 (2 devices) I found that the widget does not open the activity. Clicki but nothing happens.

Can you tell me why? Should I request some permission?

B4X:
#Region  Service Attributes
    #StartAtBoot: False
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim Widg As RemoteViews
End Sub
Sub Service_Create
    Widg = ConfigureHomeWidget("widget", "Widg", 0 , "Insert",True)
End Sub

Sub Service_Start (StartingIntent As Intent)
    If Widg.HandleWidgetEvents(StartingIntent) Then Return
    'Widg.SetImage("ButtonOk",LoadBitmap(File.DirAssets,"add.png"))
End Sub

Sub Service_Destroy

End Sub

Sub Widg_RequestUpdate
    Widg.UpdateWidget
End Sub

Sub Widg_Disabled
    StopService("")
End Sub

Sub ButtonOk_Click
    StartActivity("insert")
End Sub
 

Star-Dust

Expert
Licensed User
Longtime User
Yes, but could I send it in private? It is an App already published on Google Play, I would like to keep the private sources.

PS. Now I'm out, I can post the source at noon
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Yes, thanks for the suggestion, I had not thought about it. I will do so
.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I took the source of my App and I removed all the code. I left only the Widget and the Main Layout. I also left the Manifest (and Widget) as it is in the original App.

The defect continues to do so. I attach the source.

Thank's
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
after removing the dropbox sync entries from your manifest it works fine here....
Note that dropbox sync has stopped and can be removed

WhatsApp Image 2017-12-04 at 14.43.08.jpeg
 
Last edited:
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Yes, I am aware of it, and it was removed from the code, I had forgotten to remove it from the Manifest.
I try now.

thank you all
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
It seemed resolved, but it is not.
After a couple of hours or half a day the widget blocked again. I have to delete and reinsert it and it works NEW.

The behavior is very anomalous having to delete widget to insert it and make it work.

Some idea?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I did the tests. There are no errors in debug mode.

When I install the first time it works correctly. When restarted, the Widget is blocked and does not return any logs. If I reinstall it works, the next reboot is blocked.

I checked the Manifest but it seems to be correct. can it be the starter service?

I enclose a trial version that presents this problem

This problem only occurs on Android 7 (and probably even 8)
 

Attachments

  • TestWidget.zip
    197.3 KB · Views: 241
Upvote 0
D

Deleted member 103

Guest
This problem only occurs on Android 7 (and probably even 8)
The problem I have had with my widget and Android 7 too.
Then I tried to delete the update from the app "Android System WebView", and did not update any more of this app, and since then everything works correctly.
But I know that it is not the right solution. For me is this solution OK, because the widget is only used by me.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
The thing is disheartening.

Is it possible that others have not had the same problems? Or nobody uses Widget on Android 7?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Yes, I tried, I put a log after every line of code, to figure out where it flips

After reboot, I have not got any logs from the widget
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Surely it is a problem of entry of the App. What do I remove the starter?

P.S. Now I try to remove the Starter on my example and see if I solve

Update: It seems to work by removing the Starter

I do not know if it's a BUGS. BUT it seems that having a single entry to the App with the Starter prevents access to the Widget
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
BTW, your app is using an Android 2.x theme. You shouldn't use this theme, there are better options.

It works fine here. Tested with Android 8 and B4A v7.30. There were improvements in the way the starter service is managed in B4A v7.00. They probably fixed the issue that you are seeing.

Note that it takes about 30 seconds for the widget to be ready (or at least to allow starting the activity).
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Yes I know it takes 30 seconds, I will try to have my program compiled by a friend who has version 7.30.

If there are improvements, I will update the post
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
BTW, your app is using an Android 2.x theme. You shouldn't use this theme, there are better options.

It works fine here. Tested with Android 8 and B4A v7.30. There were improvements in the way the starter service is managed in B4A v7.00. They probably fixed the issue that you are seeing.

Note that it takes about 30 seconds for the widget to be ready (or at least to allow starting the activity).
Confirmed on B4A 7.30 there is no problem. The conclusion that it is a BUGS of the management of the Starter service in version 6.5.

Since I use B4A 6.5 and I imagine that it will not be released version 6.51 that fixes the bugs, I solved by removing the Starter service. Now everything works correctly.

Regarding the 2.x theme, my App also works on very old versions of Android. But in fact I think there are very few devices that use them, so I followed your suggestion and I updated.

Thank you and @DonManfred for the help you have given ;)
 
Upvote 0
Top