Android Question [Solved] Error when I change the PackageName in StickerPack to Whatsapp Library

asales

Expert
Licensed User
Longtime User
I'm testing the Sticker4W from @DonManfred (thanks!), but If I change the packagename "de.donmanfred.sticker" to another, I get an error.
In the first time I don't see no logs, but compile again, I get this error:
B4X:
main_activity_create (java line: 369)
java.lang.IllegalStateException: could not fetch from content provider, de.donmanfred.sticker.stickercontentprovider
    at com.sticker4w.StickerPackLoader.fetchStickerPacks(StickerPackLoader.java:48)
    at de.donmanfred.StickerPackLoaderwrapper.fetchStickerPacks(StickerPackLoaderwrapper.java:37)
    at de.donmanfred.sticker3.main._activity_create(main.java:369)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
    at de.donmanfred.sticker3.main.afterFirstLayout(main.java:104)
    at de.donmanfred.sticker3.main.access$000(main.java:17)
    at de.donmanfred.sticker3.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    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:440)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

The line in Activity_Create is correct:
B4X:
prov.Initialize("Provider",Application.PackageName&"."&"stickercontentprovider")

But I don't know how to fix it.

Thanks in advance for any tip.
 

asales

Expert
Licensed User
Longtime User
Yes. I use the release mode (obfuscated) in real device.

I am using your example.
The only change I made is in the package name:
"de.donmanfred.sticker2"
 
Upvote 0

asales

Expert
Licensed User
Longtime User
I checked the logs from your example and I get "null" in the log of this line:
B4X:
    prov.Initialize("Provider",Application.PackageName&"."&"stickercontentprovider")
Log("prov.Authority)
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
@DonManfred
really, when i change the package name it give crash
here is the logs





i m changed the app packagename and on this line too
B4X:
in.putExtra("sticker_pack_authority", "douglas.app.teste.stickercontentprovider")
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
really, when i change the package name it give crash
i think i see the problem though it just crashes here without any log (must look into unfiltered log).
Looks like it is not possible to change this setting at runtime. Or i´m doing something wrong.

I´m investigating.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…