Android Question hello by giving me this error?

desof

Well-Known Member
Licensed User
Longtime User
B4X:
Installing file.
PackageAdded: package:com.generic.sample
** Activity (main) Create, isFirst = true **
main_updatestatus (java line: 679)
java.lang.RuntimeException: Object should first be initialized (Notification).
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:46)
    at anywheresoftware.b4a.objects.NotificationWrapper.SetInfo2(NotificationWrapper.java:140)
    at anywheresoftware.b4a.objects.NotificationWrapper.SetInfo(NotificationWrapper.java:121)
    at com.generic.sample.main._updatestatus(main.java:679)
    at com.generic.sample.main._activity_create(main.java:319)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
    at com.generic.sample.main.afterFirstLayout(main.java:89)
    at com.generic.sample.main.access$100(main.java:16)
    at com.generic.sample.main$WaitForLayout.run(main.java:74)
    at android.os.Handler.handleCallback(Handler.java:605)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4699)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
    at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Object should first be initialized (Notification).
** Activity (main) Resume **
** Service (service1) Create **
** Service (service1) Start **
startService: class anywheresoftware.b4a.samples.httputils2.httputils2service
** Service (httputils2service) Create **
** Service (httputils2service) Start **
"}]
hola244
hola
 

desof

Well-Known Member
Licensed User
Longtime User
Can you post the code in UpdateStatus sub?


B4X:
Sub UpdateStatus
Dim tmp As String

If ESTADO="STOP" Then
  lblStatus.Text="listo..."
  PauseButton.Visible=False
  PlayButton.Visible =True
  PlayButton.Enabled =True
  StopButton.Enabled=False
  tmp=""
Else If ESTADO="PLAY" Then
  lblStatus.Text="En el aire..."
  PauseButton.Visible=True
  PlayButton.Visible =False
  StopButton.Enabled=True
  tmp="Reproduciendo"
Else If ESTADO="PAUSE" Then
lblStatus.Text="Pausado..."
  PauseButton.Visible=False
  PlayButton.Visible =True
  StopButton.Enabled=True
  tmp="Pausado"
Else
  'STOP VER
    tmp=""
    lblStatus.Text="..."
End If
Service1.Notification1.SetInfo("Radio",tmp,"Main")
Service1.Notification1.Notify(1)

End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…