Android Question Recursive entry to executePendingTransactions

ykucuk

Well-Known Member
Licensed User
Longtime User
Hello,

I am using NotificationBuilder for notify my users.

This library support set Tag for each notify and read it Activity_Resume.

B4X:
Sub Activity_Resume
Try
Dim in As Intent
Dim intentExtra As String
in = Activity.GetStartingIntent
If in.HasExtra("Notification_Tag") Then
intentExtra = in.GetExtra("Notification_Tag")
Select Case intentExtra
Case"Message"
DrawScreen("Messages")
Case"Notify"
DrawScreen("Notifications")
Case"Visitor"
DrawScreen("IconWho")
Case "Bid"
DrawScreen("SeeAllBids")
EndSelect
End If
Catch
Log (LastException)
End Try
EndSub

After get Notify Tag when i try call another function i got below error. Any help
B4X:
java.lang.IllegalStateException: Recursive entry to executePendingTransactions
 

Attachments

  • Screen Shot 2016-12-31 at 10.52.57.png
    Screen Shot 2016-12-31 at 10.52.57.png
    46 KB · Views: 251

DonManfred

Expert
Licensed User
Longtime User
You should only call it only once for a intent...
B4X:
' Globals
dim lastintent as Intent

In Activity_resume
B4X:
Dim in As Intent
Dim intentExtra As String
in = Activity.GetStartingIntent
if in <> lastintent then
  lastintent = in
  ' Here your code
  If in.HasExtra("Notification_Tag") Then
    intentExtra = in.GetExtra("Notification_Tag")
    Select Case intentExtra
    Case"Message"
      DrawScreen("Messages")
    Case"Notify"
      DrawScreen("Notifications")
    Case"Visitor"
      DrawScreen("IconWho")
    Case "Bid"
      DrawScreen("SeeAllBids")
    EndSelect
  End If

end if
 
Upvote 0

ykucuk

Well-Known Member
Licensed User
Longtime User
You should only call it only once for a intent...
B4X:
' Globals
dim lastintent as Intent

In Activity_resume
B4X:
Dim in As Intent
Dim intentExtra As String
in = Activity.GetStartingIntent
if in <> lastintent then
  lastintent = in
  ' Here your code
  If in.HasExtra("Notification_Tag") Then
    intentExtra = in.GetExtra("Notification_Tag")
    Select Case intentExtra
    Case"Message"
      DrawScreen("Messages")
    Case"Notify"
      DrawScreen("Notifications")
    Case"Visitor"
      DrawScreen("IconWho")
    Case "Bid"
      DrawScreen("SeeAllBids")
    EndSelect
  End If

end if
Thank You for ur help.

I changed code as u wrote and got another error when activity_resume code block run

You can see new error message in attachement
 

Attachments

  • Screen Shot 2016-12-31 at 15.47.09.png
    Screen Shot 2016-12-31 at 15.47.09.png
    66.2 KB · Views: 235
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
1. This is a new issue! You should create a NEW Thread for EACH question.
2. You should post errors as TEXT from the log instead of a screenshot
3. Your code cannot find a Resource. Without seeing your code we cant help. Start with 1) and give us enough informations to help.
 
Upvote 0

ykucuk

Well-Known Member
Licensed User
Longtime User
1. This is a new issue! You should create a NEW Thread for EACH question.
2. You should post errors as TEXT from the log instead of a screenshot
3. Your code cannot find a Resource. Without seeing your code we cant help. Start with 1) and give us enough informations to help.
I really didnt know that this 2 problems arent related. sorry. I ll do as you suggest. Thank you
 
Upvote 0
Top