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. How to launch activity act2.class (contained in project2.apk) from activity1 in project1.apk ?

hi,

try this:

Intent intent = new Intent();
                                intent.setComponent(new 
ComponentName("gal.com.app",
"gal.com.app.gallery"));
                                startActivity(intent);

Where gal.com.app is the name of the other package in which the other
activity resides and gal.com.app.gallery is the application name
appended with the name of the activity in the other package





--~--~---------~--~----~------------~-------~--~----~

2. SoftKeyboard - detecting pressed key

Hi,

I am currently developing an android app which opens the soft keyboard
in order to get an input from the user.
I would like to detect when the user has finished using the soft
keyboard by clicking the "Done" key.
Is there anyway I can do it? Is there some kind of event that I can
catch to detect that the user pressed the "Done" key or that the soft
keyboard was closed?

Thanks,
Hilly

--~--~---------~--~----~------------~-------~--~----~

3. Choosing a reliable Web Hosting company

4. Android 2.0 Google Maps Navigation and app use of turn-by-turn directions?

5. Example Needed: a view containing a reference to its activity

6. First QVGA Android Phone 鈥?H TC Tattoo鈩?鈥?on sale October 2009. Is your application r eady?

7. use data network while connected to wifi