[android-developers] Repeating AsyncTasks t

2010-04-13 Thread Lee Jarvis
I'm not sure if I'm going the right way about this.. but.. I have both username and password fields, as well as a login button. When the login button is clicked I grab both the username and password and attempt an online login. The authentication happens inside of an AsyncTask so I can display a

[android-developers] Repeating an AsyncTask

2010-04-13 Thread Lee Jarvis
Hi guys, I have an Activity which uses Http based authentication to log a user into an online site. I'm using an AsyncTask to handle authentication in the background so I can display a ProgressDialog in the meantime. If the user login fails they should be given another chance. Of course, though,

[android-developers] Re: adb cannot find my dev phone

2009-11-14 Thread Lee Jarvis
Read the documentation: http://developer.android.com/guide/developing/device.html If it's a permissions issue try running `abd kill-server` followed by `adb devices` as root, if your device shows you can either leave it be, and switch back to a regular user and commence with debugging etc, or

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-11 Thread Lee Jarvis
Ahh! That makes total sense, I was trying to do more or less the same thing but it got tricky a there were a few flaws, this is great. I have a much better understanding of things now. Thanks On 11 Nov, 01:22, Lance Nanek lna...@gmail.com wrote: Here's a quick attempt at rewriting it without a

[android-developers] ListActivity searching

2009-11-11 Thread Lee Jarvis
I realize there is many ways to search a through a list (you can just start type, or you can use the hardware search button to open the search dialog). I've seen in many applications there is a button to open the search dialog, as if you pressed the hardware search button. I've searched around

[android-developers] Re: ListActivity searching

2009-11-11 Thread Lee Jarvis
Ahh perfect! Thanks Mark On Nov 11, 12:18 pm, Mark Murphy mmur...@commonsware.com wrote: Lee Jarvis wrote: I realize there is many ways to search a through a list (you can just start type, or you can use the hardware search button to open the search dialog). I've seen in many

[android-developers] Async thread aborted after catching (all?) exceptions

2009-11-11 Thread Lee Jarvis
I have the following code... @Override protected Void doInBackground(Void... unused) { Log.i(TAG, invoking background thread); try { mClient.get(http://thishostdoesntexist;); } catch

[android-developers] Re: Async thread aborted after catching (all?) exceptions

2009-11-11 Thread Lee Jarvis
() method raises an exception, at the moment getting anything but a force close just isn't happening On 11 Nov, 18:43, Lee Jarvis ljjar...@googlemail.com wrote: I have the following code...         @Override         protected Void doInBackground(Void... unused) {                 Log.i(TAG

[android-developers] Re: Async thread aborted after catching (all?) exceptions

2009-11-11 Thread Lee Jarvis
/AndroidRuntime(797): at android.os.AsyncTask$2.call(AsyncTask.java:185) 11-11 21:47:02.280: ERROR/AndroidRuntime(797): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256) On 11 Nov, 21:24, Mark Murphy mmur...@commonsware.com wrote: Lee Jarvis wrote: So I've been sifting

[android-developers] Re: Async thread aborted after catching (all?) exceptions

2009-11-11 Thread Lee Jarvis
Ahh yeah that makes total sense now. Can't believe I didn't notice that Thanks again On Nov 11, 10:16 pm, Mark Murphy mmur...@commonsware.com wrote: Lee Jarvis wrote: Yeah, my bad.. snip 11-11 21:47:02.280: ERROR/AndroidRuntime(797): Caused by: java.lang.RuntimeException: Can't create

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-10 Thread Lee Jarvis
I've tried that, too. But again to no avail, nothing I do seems to work. I've tried using the callback features whilst also implementing weak references which also doesn't work. Once I change orientation, the progressDialog never disappears, it's bugging me to hell On 8 Nov, 17:41, Streets Of

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-08 Thread Lee Jarvis
and it's trying to dismiss a dialog which doesn't exist. On 8 Nov, 03:52, Streets Of Boston flyingdutc...@gmail.com wrote: Show us your code that deals with showing/hiding the progress bar and show exactly what doesn't work. Maybe we can figure it out  :) On Nov 7, 5:32 pm, Lee Jarvis ljjar

[android-developers] AsyncTask and ProgressDialog

2009-11-07 Thread Lee Jarvis
Hey guys, I have the following code.. public class MyActivity extends Activity { private final static int DIALOG_TASKING = 1; ProgressDialog mLoadingDialog; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-07 Thread Lee Jarvis
: Lee Jarvis wrote:   The code works fine, except when I try and change screen orientation, the progress dialog doesn't disappear and the task seems to be executed again, I realize this is because the onCreate() method is being called again on orientation change perhaps? Yes. By default

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-07 Thread Lee Jarvis
will show, but the ProgressDialog will never actually disappear. On Nov 7, 2:41 pm, Mark Murphy mmur...@commonsware.com wrote: Lee Jarvis wrote: This code (kinda) works, the only problem is dismissing the dialog if the activity is recreated. I've tried dismissing it if mTaskComplete is true

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-07 Thread Lee Jarvis
altered. Thanks for any replys On 7 Nov, 14:53, Lee Jarvis ljjar...@googlemail.com wrote: I apologise if I'm missing something or just being stupid.. But i've tried the following..     @Override     public void onDestroy() {         dismissDialog(DIALOG_TASKING);         super.onDestroy

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-07 Thread Lee Jarvis
7, 9:53 am, Lee Jarvis ljjar...@googlemail.com wrote: I apologise if I'm missing something or just being stupid.. But i've tried the following..     @Override     public void onDestroy() {         dismissDialog(DIALOG_TASKING);         super.onDestroy();     } The dialog

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-07 Thread Lee Jarvis
).show();                 }     } } You may need to put null checks in your code before using ACTIVE_INSTANCE. But, you get the idea :) On Nov 7, 11:45 am, Lee Jarvis ljjar...@googlemail.com wrote: Ah ok, that makes sense. Thanks for your reply. I understand what you're saying

[android-developers] Re: AsyncTask and ProgressDialog

2009-11-07 Thread Lee Jarvis
Any other suggestions? I keep trying different things out but nothing seems to work, I keep seeing common applications with the same functionality which is making it more frustrating because I know it should work fine On 7 Nov, 17:29, Lee Jarvis ljjar...@googlemail.com wrote: Thanks for your

[android-developers] ListActivity implements OnItemLongClickListener

2009-10-14 Thread Lee Jarvis
I'm attempting to implement a long click listener on a list activity that simply works the same way as when you long click on a contact in your address book. That is, displaying an AlertDialog with a list of options (one option might be to add the value clicked as a favorite or something). I've

[android-developers] Re: ListActivity implements OnItemLongClickListener

2009-10-14 Thread Lee Jarvis
That works great, thankyou. One more thing, though. I have tried to mess around with onContextItemSelected() and attempted to get the original text from the list item I clicked through the ContextMenuInfo interface, but there doesn't seem to be a clear way to achieve this. All I basically need

[android-developers] Re: ListActivity implements OnItemLongClickListener

2009-10-14 Thread Lee Jarvis
would the best be? I don't seem to be able to grab the text as easily using any other methods. Thanks. On Oct 15, 1:48 am, Mark Murphy mmur...@commonsware.com wrote: Lee Jarvis wrote: That works great, thankyou. One more thing, though. I have tried to mess around with onContextItemSelected

[android-developers] ListActivity and an alternative view for error message?

2009-10-13 Thread Lee Jarvis
So I have a ListActivity that implements an ArrayAdapter list. I have a control statement within onCreate() that checks if we have any Array values to populate our list, if we do.. set up the list and display it. The problem is, what happens when we don't. Ideally what I'd like to do is simply

[android-developers] Re: ListActivity and an alternative view for error message?

2009-10-13 Thread Lee Jarvis
.) On Tue, Oct 13, 2009 at 5:42 PM, Lee Jarvis ljjar...@googlemail.com wrote: So I have a ListActivity that implements an ArrayAdapter list. I have a control statement within onCreate() that checks if we have any Array values to populate our list, if we do.. set up the list and display

[android-developers] Re: HTTP GET and ProgressDialog

2009-10-12 Thread Lee Jarvis
Ok so I kind of implemented this, but it forces close when I click the button.. What am I doing wrong? package net.gullycorp.example.webtest; import java.io.IOException; import org.apache.http.client.ClientProtocolException; import android.app.Activity; import

[android-developers] Re: HTTP GET and ProgressDialog

2009-10-12 Thread Lee Jarvis
Sorry, I realized in that above example I passed to arguments to execute(), not that it makes any difference to my issue. On Oct 12, 11:58 pm, Lee Jarvis ljjar...@googlemail.com wrote: Ok so I kind of implemented this, but it forces close when I click the button.. What am I doing wrong

[android-developers] Re: HTTP GET and ProgressDialog

2009-10-12 Thread Lee Jarvis
Ok so I updated the code again, and I guess it pretty much works. Would any of this be discouraged? Or would there be a better way of doing this? http://pastie.org/652258 Regards, Lee --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[android-developers] Internet Permission issue and HTTP Requests

2009-10-11 Thread Lee Jarvis
Hi, I am trying to develop an application that simply downloads a web page, creates a new TextView, and sets the text to the web page's source (or content). I have been playing with apaches HTTP library and have some example code up and running, everything 'should' work, but it doesn't. Every

[android-developers] HTTP GET and ProgressDialog

2009-10-11 Thread Lee Jarvis
Hi guys, I have a small test application that simply grabs a URL from an EditText box, before downloading the page source for the URL, prompting the user to ask if it should display the contents, then doing so, or returning state. I would like to incorporate a ProgressDialog to appear whilst the

[android-developers] Re: HTTP GET and ProgressDialog

2009-10-11 Thread Lee Jarvis
Thanks, I'll give it a go. What's with the (ick)? AlertDialog? On 11 Oct, 22:08, Mark Murphy mmur...@commonsware.com wrote: Lee Jarvis wrote: Hi guys, I have a small test application that simply grabs a URL from an EditText box, before downloading the page source for the URL, prompting

[android-developers] Re: HTTP GET and ProgressDialog

2009-10-11 Thread Lee Jarvis
. I guess I'll try and find some examples of using AsyncTask that aren't too complex. On 11 Oct, 22:53, Mark Murphy mmur...@commonsware.com wrote: Lee Jarvis wrote: What's with the (ick)? AlertDialog? Well, in your test app, it's probably fine. I worry about people overusing modal dialogs