ProgressDialogShow freezes Input

Vidar

Member
Licensed User
Longtime User
Hi folks :)

I've got another Problem and I don't know whether it is a bug or I am missing something.

The Problem is, that the EditText-View I use isn't editable anymore, when I call a "ProgressDialogShow" or "ProgressDialogShow2" and then free it with an ProgressDialogHide. I don't know if it's the EditText that's blocked or the virtual Keyboard, that doens't respond anymore. When I remove the Dialog, everything works as intended :)
The cursor is shown in the EditText, The Longclick-Event fires fine, also, but I can't change the Text.

Hope, anybody could help me!
Thanks in Advance
~Michael
 

agraham

Expert
Licensed User
Longtime User
It sounds from your description that it is working as intended. Whille the ProgressDialog is shown the underlying Activity will be greyed out and the spinning circle will be shown. Your code can execute during this time but your user interface will be inaccessible as the ProgressDialog has taken over the screen.
 

Vidar

Member
Licensed User
Longtime User
@Erel, agraham
Thanks for your answers, but they did not really help me :D

agraham, I know how the ProgressDialogShow works, but shouldn't it make my interface accessible again, when I call ProgressDialogHide? I can click buttons etc after the Processdialog, but my Edittext acts as if it was enabled = false;

Like I said, when i delete the ProgressDialogShow, everything is working as intended, even the edittext.

I don't know why that is :confused:
 

Vidar

Member
Licensed User
Longtime User
@Erel:
Works fine ;)

@agraham:
I am sorry. Next time i will try to speak plain english :) Thought, it would be clear, what I meant. Sorry :)

Maybe some Code would be helpful:

B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim request As HttpRequest
    Dim p1black, p3black, ... As Bitmap

   If FirstTime Then
   ... 'Some initializing here    
    End If
      
   p1black = LoadBitmap(File.DirAssets, "bSearch.png")
   p3black = LoadBitmap(File.DirAssets, "bSign-Down.png")
        ... 'Some more Stuff like that
    
   Activity.LoadLayout("main")
   
   TabHost1.AddTabWithIcon("Suche", p1black, p1white, "pSuchen")
   TabHost1.AddTabWithIcon("Downloads", p3black, p3white, "pDownloads")
         ... 'And so on

   request.InitializeGet("XXXX") 'Just to hide my Webservices :D
   
   If hcRev.Execute(request, 1) = False Then Return
   'ProgressDialogShow2("Initialisiere. Bitte warten...", False)

Sub hcRev_ResponseSuccess (Response As HttpResponse, TaskId As Int)
   Dim ergebnis() As String
   
   ergebnis = Regex.Split(":",Response.GetString("UTF8"))
        ... 'Initializing some Strings I need
   
        ProgressDialogHide
End Sub

After the ProgressDialog is gone, everything works, but I can not edit an Edittext, which is on a panel in a tabhost. I can even work with the text of it and it says, that it is enabled = true; but it just does not do anything, when I press a key on the Keypad.
 

Vidar

Member
Licensed User
Longtime User
@Erel:

No, there is nothing above it. I can also see the Cursor in that field, but nothing happens, when i type something. Not on my Desire and not in the Emulator.

That EditText also has the focus, when the app is starting. The EditText in your example hadn't. I am going to play around a little.

I'll report back if I succeed :D
 

Vidar

Member
Licensed User
Longtime User
Found a quick and dirty workaround :)

When I make an edSuche.Text = edSuche.Text before I call the ProgressDialogHide, the EditText is accessible again.

Thanks, Erel and agraham:sign0089:
 
Top