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. broadcastIntent problems

Hi,
 
I have a service started by an activity that spins its own thread to
perform tasks. Everytime a task is performed and finished, the service
needs to send a message back to the activity to update an image and text
on the current view. What I thought of using was broadcastIntent and
intent receiver. However, it seems like my intent receivers are only
invoked if I use the broadcastIntent call that specifies its own
IntentReceiver as the final one. Otherwise, it just doesn't do anything
at all. Here's how I defined the receivers in the manifest:
 
<receiver

android:name=".app.SuperPagesMain.MainIntentReceiver"
android:process=":remote" />

<receiver android:name=".app.IntentReceiverTest"
android:process=":remote" />

 

The first is an inner-class that's declared public, the second is its
own class. If either is specified in broadcastIntent, it is called
correctly, but not on its own. What gives?

Any insight is much appreciated,

Ahmad


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

2. How to specify the library classpath when deploying from Eclipse

I'm try to run an application that I built using Eclipse. My
application is supposed to use a library and to get extra parameter.
When using directly the command line to run my application (adb
shell), I have no problem to set the classpath of my library and to
specify any parameter, but when I deploy with Eclipse, how can't find
how to set these values required at runtime ?
--~--~---------~--~----~------------~-------~--~----~

3. Displaying softkey component in Mobile application

4. StackOverFlowError on the TimePicker Widget

5. $$$$

6. Is it possible to create jad and jar file for android

7. Application installer question