droidchef / android-lockpattern

Automatically exported from code.google.com/p/android-lockpattern
Apache License 2.0
0 stars 0 forks source link

Long "loading" dialog between first entry and confirmation #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Fire an intent with LockPatternActivity.ACTION_CREATE_PATTERN
2. Enter the first pattern.

What is the expected output? What do you see instead?
I would expect the confirmation to immediately appear. Instead a loading dialog 
appears which lasts for about 20 seconds, then confirmation proceeds as normal. 
This only happens the first time you create a pattern; if you cancel and retry 
the loading doesn't happen.

What version of the product are you using? On what operating system?
I'm using a clone from today on a Galaxy S4 running Android 4.2.2.

Please provide any additional information below.
I stepped through with a debugger; it appears the problem is in 
doCheckAndCreatePattern().

Original issue reported on code.google.com by zrussell...@gmail.com on 6 Jul 2014 at 6:40

GoogleCodeExporter commented 9 years ago
Thanks for filing the issue.

Would you please help me with these questions?

- If you used the code in your app (not the demo app), could you try the demo 
app on your device and reproduce that bug?

- Did you use custom encrypter which might take time?

I'm sorry for the ads in the demo. I'll add option to remove ads for 
contributors like you. (I'm not sure when I'll have time...)

Original comment by haibison...@gmail.com on 7 Jul 2014 at 2:41

GoogleCodeExporter commented 9 years ago

Original comment by haibison...@gmail.com on 7 Jul 2014 at 2:41

GoogleCodeExporter commented 9 years ago
I just tried it in the demo app - no loading delay. I'll paste in a comment how 
I'm starting the activity, although I'm fairly certain I just did it the way 
you recommended in the quick start guide. I'm also going to dig a bit and try 
to find a difference between our implementations.

I'm not using any custom encryption or anything, either.

Original comment by zrussell...@gmail.com on 7 Jul 2014 at 1:50

GoogleCodeExporter commented 9 years ago
This is in the onCreate method:

// Add action listeners
final UserInitActivity self = this;
((Button) findViewById(R.id.patternButton))
        .setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i = new Intent(
                        LockPatternActivity.ACTION_CREATE_PATTERN,
                                        null, self, LockPatternActivity.class);
                startActivityForResult(i, PATTERN_RESULT);
            }
        });

Original comment by zrussell...@gmail.com on 7 Jul 2014 at 1:54

GoogleCodeExporter commented 9 years ago
I've found the cause; I had a long-running AsyncTask already running, and 
apparently this interfered with the AsyncTask used by your library. If I don't 
start my task, the dialog doesn't appear, and the dialog only takes as long as  
my task does anyway. I think this bug is finished, I just need to increase the 
size of the thread pool.

Original comment by zrussell...@gmail.com on 8 Jul 2014 at 2:27

GoogleCodeExporter commented 9 years ago
Thank you. That's a lesson for me.

I'm glad you solved it. Have a nice day  :-)

Hai,

Original comment by haibison...@gmail.com on 8 Jul 2014 at 9:51