java - Why does a dialog seemingly have its one thread? -


i'm new advanced programming - i've read, android programs on 1 thread.

this means, 1 line of code or method/function can executed @ time before moving on next line (that's thought anyway).

however, i'm using custom dialog develop application , yet, program continues after dialog has ran. i'd program wait dialog close can receive input , manipulate it.

this seems straightforward when programming in java (e.g. scanner tool waits user input before proceeding opposed running code following while waits user input).

how can this?

everything happen on 1 thread unless explicitly tell not to. however, showing dialog happens asynchronously. basically, when ask dialog show, adds information list of ui events waiting happen, , happen @ later time.

this has effect code after asking dialog show execute right away.

to have execute after dialog choice made, add ondismisslistener dialog , whatever want in ondismiss.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -