Java Question java.lang.IllegalArgumentException: background is null.

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Hello all ,

I am trying to wrap this project https://github.com/fanrunqi/WaveProgressView but can not find a way to solve this error which crashes the app too .
It might be something related to resource xml files but I could not find a helpful tutorial or information .
I upload compiled library , source code and B4a Example

Thanks in advance
 

Attachments

  • WaveProgressViewCompiledLib.zip
    7 KB · Views: 246
  • waveprogressSource.zip
    14.2 KB · Views: 260
  • waveprogressviewb4aexample.zip
    2 KB · Views: 247

DonManfred

Expert
Licensed User
Longtime User
- the example does not compile. the initialze is missing a parameter (bitmap)
- But the source does not have this parameter in initialize!?

Additional you are setting a null to the bitmap in initialize of the wrapper
B4X:
        cv = new WaveProgressView(ba.context, null);

The app crashes because the background is null

LogCat connected to: 9885e6514556383552
--------- beginning of main
--------- beginning of system
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 344)
java.lang.IllegalArgumentException: background is null.
at cn.fanrunqi.waveprogress.WaveProgressView.Init(WaveProgressView.java:108)
at cn.fanrunqi.waveprogress.WaveProgressView.<init>(WaveProgressView.java:71)
at cn.fanrunqi.waveprogress.WaveProgressView.<init>(WaveProgressView.java:66)
at smm.waveprogress.waveprogresswrapper._initialize(waveprogresswrapper.java:53)
at smm.waveprogress.waveprogresswrapper.Initialize(waveprogresswrapper.java:43)
at smm.library.example.main._activity_create(main.java:344)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at smm.library.example.main.afterFirstLayout(main.java:102)
at smm.library.example.main.access$000(main.java:17)
at smm.library.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
- the example does not compile. the initialze is missing a parameter (bitmap)
- But the source does not have this parameter in initialize!?
Sorry for that , I tried passing bitmap to the library , set it as background and that worked but I don't think that is the right way to create a library with resources.
I changed that later but I think I forgot to recompile .
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
I cant get it to work :-(

I tried to do a complete new wrap... The same

Here is the latest compiled version
I modified the original library to be able to set background bitmap .
I do not know how to fix pixelated result issue .
 

Attachments

  • WaveProgressView.zip
    6.8 KB · Views: 270
Top