Your code is quite difficult to read on a text editor, because of the crazy
naming convention.  It's much more time than what I can devote today.

But if this SelectPlayer activity is the one opening in a wrong time, your
problem is probably in the other activity, the one that has the
startActivityForResult.

About singleTop, if the "onCreate" for your SelectPlayer is called anyway,
it could mean that it's not launched on the same "task" that the first one,
or that the activity on top is not an instance of SelectPlayer, but another
activity. It could give you a clue on where the problem could be.

Marina

On Mon, Feb 27, 2017 at 2:31 PM, Keith Sheppard <ke...@writerman.org.uk>
wrote:

> My main activity kicks off a secondary activity (using
> startActivityForResult) that invites the user to input details of one of
> four players at a bridge table.
>
> When the user has chosen a player and clicked OK, the following things
> happen (triggered by code in onActivityResult)
>
> 1. The player details (passed back in the Intent returned by the secondary
> activity) are written to a text file.
> 2. An AsyncTask is started to send that file to a server PC using SMB.
> 3. While the AsyncTask is still running, the same secondary activity is
> invoked again to get the next player's details.
>
> This sequence is repeated until all four players' details have been sent
> to the server.
>
> On my tablet, this works perfectly every time but one of my beta testers
> has a bizarre problem. He can usually enter the first player's name
> successfully, sometimes the second and occasionally the third but
> eventually one of the names screens appears for a short time later only to
> disappear again without the user clicking my OK button.
>
> Note that the player-names screen allows the user to type a partial name
> and uses a ListView to display all players in a club membership list that
> contain the letters typed. I don't know if that's significant.
>
> What I am seeing in my trace file is that the onCreate method of the
> select player activity is called. The OKClicked method is never called. In
> fact, I have trace points before every finish() call in the select player
> activity and none of them is called. After the onCreate call, the next
> thing I see in my trace file, about 30 seconds later, is onActivityResult
> reporting a ResultCode of zero and the returned Intent pointer of null. In
> other words, the select player activity has spontaneously closed without
> the user clicking OK or it going through any of my code designed to close
> the activity tidily.
>
> This never happens on my tablet, which is running Android 4.4.2. It always
> happens on my beta tester's tablet, which is running 4.4.
>
> After reading reports of a similar Android problem, I changed all the
> activities' settings in my manifest (including the main activity) to
> launchMode singleTop but this made no difference.
>
> Any suggestions? This is particularly awkward because I cannot reproduce
> the problem on my kit. I am having to do all my debugging remotely by
> adding trace points and asking my beta tester to repeat the experiment.
>
> I have uploaded the code for the select player activity in case it's of
> interest.
>
> Kind regards
> Keith
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/android-developers/6502018f-b8b0-4dbb-a3a8-
> b132458cca3d%40googlegroups.com
> <https://groups.google.com/d/msgid/android-developers/6502018f-b8b0-4dbb-a3a8-b132458cca3d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CACaNmX3YbN2iYiTM%3DzfbNZexu4JU1LGGKJ9HQRA-RHboL_ch1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to