Android Question Problem with time running and destroy activity

CyclopDroid

Well-Known Member
Licensed User
Longtime User
I've two problem.

PROBLEM ONE
If run my game, the varible and data have old value...but if I set the Break-Point into set this value, it's work perfectly. :eek:
I've insert a DoEvents command and create a sub timer pause... but nothing. The value not change, but eith BreakPoint, change. :(
Tests are made with Genymotion Android emulator for Pc (I7).
Exist a command when attend the value it's empty or changed, firt to continue?
This imy code:

B4X:
Dim strPlay As String
DoEvents:DoEvents
'if I set a  break-point  strPlay Change ...else NOT Change.
Log("Record:" & str)
strPlay=str
DoEvents:DoEvents
Dim arrayapp(4) As String

If I set thebreak point... the strPlay have a true value str value. Log RECORD print a true value
If not set a break point... the Log RECORD print a true value but the Log NEW ARRAY, have a OLD value (view down) :eek::eek:

B4X:
For i=0 To List1.Size-1
      Decrypt(List1.Get(i))
      DoEvents
      Log(str)
      'If  it's the selected player,  rewrite else not change
         If i<>Main.fndPlayer Then
            arrayapp(i)= str 'str is the Derypted Value
            Log("ARRAY:" & arrayapp(i))
         Else         
            arrayapp(i)=strPlay 'Write new value
            DoEvents
            Log ("New Array:" & arrayapp(i)) 'If no set a Break Point  strPlay have a OLD VALUE!!!
            xp=i
            DoEvents
      End If
      arrayapp(i)=Crypt(arrayapp(i))
      arrayapp(i)=str
   Next


PROBLEM TWO
Another problem is the activity into Task Manager.
When the Player set a Record, I start an activity for publisher the score and immage into Facebook... when the player go to back, and I close Activity with Activity.finish, it's set open into task manager.
I've set to Manifest.XML a:

android:clearTaskOnLaunch="true"

But not work when the App it's alredy lauched.

Ecist a mede to destroy Activity from Rasm Manager?

Thanks for your supports.
 

LucaMs

Expert
Licensed User
Longtime User
Problem one: I think it is elsewhere, where you set the value of str (very bad name ;)).

Problem two: you have forgotten to point out that you use an Intent to launch another app; I think you can not have control of this second app.
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime User
Problem one: I think it is elsewhere, where you set the value of str (very bad name ;)).
No. because if I set the breack point, the vaue of strPlay it's empty and when I press F8 it's egual at str value. But, if i dont set a BreakPoint...this value is the OLD value (in first start it's empty)! :O
The Sub not recall.

For example in this Idiot SUb: :p
B4X:
Sub Test_click
   strAppo=Main.str
   Main.str="Test me Key"
   SartActivity(Call2Test)
   Main.str=strAppo
end Sub

if value of MAin.str is "Good Work" to start main.. in this case the value not change, because first Main.str have a "Test me Key" value but, wehen start Activity it's not block... continue to end sub and into Activity Call3Test the value is Main.str=strAppo :O :O :O
It's simple code it a example to see when the programm not stop to startactivity and return it when exit...but continue to end sub and change allvalue and pass to activity...it's not good. :eek:

Problem two: you have forgotten to point out that you use an Intent to launch another app; I think you can not have control of this second app.
Ok, the activity create event with intent...but when I close it to destroy anyway. The Activity of my game, when I exit (if call Ativity.finish or ExitActivity), stay alone into a Task Bar menu. :(
I want terminate for ALL and destroy event from Task menu...I want be a Task killer command.[/code]
 
Last edited:
Upvote 0
Top