[android-developers] eula with asynctask ?

2010-12-28 Thread dan
I'm trying to enforce agreement using the
com.google.android.divideandconquer Eula class [1]. However my app
fires off an AsyncTask before I can accept or reject.

My code:

public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Eula.show(this);
new ExportTask().execute();
}

Am I missing something programmatic?

tia,
dan

[1] 
http://code.google.com/p/apps-for-android/source/browse/trunk/DivideAndConquer/src/com/google/android/divideandconquer/Eula.java?r=93

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] eula with asynctask ?

2010-12-30 Thread TreKing
On Fri, Dec 24, 2010 at 8:36 AM, dan  wrote:

> Am I missing something programmatic?


The fact that all the code in your onCreate executes sequentially. You show
your EULA dialog then you start your Task. No where are you specifying that
that execution of said task is dependent on the acceptance of the EULA.

One solution would be to update the Eula.show() method to also take an event
handler object that gets called when they click the accept option. In your
activity, this handler would then start your task.

Also, the fact that the show method itself checks the preferences to
determine whether it should actually show is rather silly, IMO. I would
change that too.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] eula with asynctask ?

2010-12-30 Thread Frank Weiss
I suppose the main problem is you are expecting the Eula.show() method to
block.

Looking at the referenced code, it is evident that the object you pass to
the show() method should implement the Eula.OnEulaAgreedTo interface (line
69). That interface declares the callback for the acceptance of the EULA,
and I suppose it's in that callback method where you should start the
AsyncTask.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en