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. Android: Get Recently used Apps

Hello!

I need a little bit help getting information about the last lets say 5
application that was opened/used.

ActivityManager m =
(ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
        RecentTaskInfo task = m.getRecentTasks(5,0).get(0);

Then i used:

String output  = "the last application you've executed is '"+task.id
+"' and the PID is '"+task.toString()+"'";
But it didnt work out well. I think im on the right track with
ActivityManager to track the latest app.

Thank you!

And ye i only need to get enough information so i can run/start them
later.

//Simon

-- 

2. car dock mode

Hi is there a broadcast even when entering/leaving car dock mode? Actually, 
finding these kind of events is a little cumbersome in the otherwise excellent 
documentation... - Thanks

-- 

3. javax.xml.bind.annotation.XmlAccessType and Android

4. is there anyone using spotify?

5. code segment vs. data segment

6. Obtaining access to the surfaceView instance

7. Canvas draw outside the bitmap.