Regarding Service

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Regarding Service

Postby capitala » Mon Dec 07, 2009 12:35 pm

How can we invoke an activity from service..............!!!

From one activity i invoke a service.Now i want to invoke other activity from that service.....How it is possible..can anyone help!!!?????????????
capitala
Freshman
Freshman
 
Posts: 4
Joined: Thu Nov 26, 2009 5:29 am

Top

Re: Regarding Service

Postby jagtap.jj1 » Tue Dec 08, 2009 6:39 am

How can we invoke an activity from service..............!!!

From one activity i invoke a service.Now i want to invoke other activity from that service.....How it is possible..can anyone help!!!?????????????

Ya its possible use inherited method "startActivity(Intent i)" of "ContextWrapper http://developer.android.com/reference/ ... apper.html, the Service extends this class"
java-android developer
User avatar
jagtap.jj1
Senior Developer
Senior Developer
 
Posts: 124
Joined: Fri Aug 22, 2008 11:52 am
Location: India(Mumbai)

Postby capitala » Thu Dec 10, 2009 6:40 am

yes u can invoke activity from service


Context con=this.getApplicationContext();

final Intent intent =new Intent(con, AlarmService.class);

intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK);


con.startActivity(intent);
capitala
Freshman
Freshman
 
Posts: 4
Joined: Thu Nov 26, 2009 5:29 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 2 guests