Calling activity from inside a thread?

by Abhi » Thu, 18 Feb 2010 23:01:09 GMT


Sponsored Links
 Hi,

I want to either use WiFiManager to toggle wifi from inside a thread
or call another activity to do this, whichever is possible. I tried
using the wifimanager class inside the thread but it didn't work.
Could anyone tell me how to call an activity using Intents from inside
a thread?

Thanks,

Abhi

--



Calling activity from inside a thread?

by Abhi » Fri, 19 Feb 2010 03:39:59 GMT


 Hi,

I want to either use WiFiManager to toggle wifi from inside a thread
or call another activity to do this, whichever is possible. I tried
using the wifimanager class inside the thread but it didn't work.
Could anyone tell me how to call an activity using Intents from inside
a thread?

Thanks,

Abhi

--


Sponsored Links


Calling activity from inside a thread?

by Steeler » Fri, 19 Feb 2010 14:09:04 GMT


 Do you have a reference to the activity's context in your thread? If
so, I think you could do something like this:

Intent _intent = new Intent(yourContext, yourActivity.class);
yourContext.startActivity(_intent);

provided that yourActivity was declared in your manifest.




--



Other Threads

1. Droid Losing Values When I Load Image Picker

I have an Android app that is mostly a WebView except for a few
things.  One of them is uploading pictures.

After the user picks an image I get the filepath and pass that along
with the webview's url to a new method in a new thread.

For some reason, in the onActivityResult method I can't get the value
from the webview to know what page they're on.  It's null.  It works
on my HTC Hero (2.1), just not on Droid's.(those are the only users
with the problem).

I've tried setting a global variable to the url before showing the
image picker, but when I try to read it in the onActivityResult method
it's just an empty string.  On my HTC Hero it still has the value.

I need the url so where can I put it where it won't get lost on Droid
phones?  This is all in an Activity.

-- 

2. Ampersand in String Array

Hi Everyone,

I've looked around for how to use an ampersand ( '&' ) in an item for
a string-array but can't seem to find it.  I feel silly for having to
ask for something this simple, but does anyone know how to escape it?

-- 

3. How to make an android notification for the application?

4. what is the basic idea of sensor driven animation

5. how export an resources attribute

6. How to use GridView with ScrollView (containg Data of ListView)

7. Can we customize spinner dialog