Starting an activity that is in another Package

Put your problem here if it does not fit any of the other categories.

Starting an activity that is in another Package

Postby wonderoid » Sun Feb 17, 2008 4:46 pm

I want to start an activity explicitly using the following:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                         Intent i=new Intent(this, MyActivity.class);
  2.  
  3.                         startActivity(i);
Parsed in 0.029 seconds, using GeSHi 1.0.8.4

Is it possible to call MyActivity if it resides in another package? Simply passing in "this" for ApplicationContext in the constructor
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent(Context packageContext, Class cls)
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
results in a wrong package name and MyActivity can not be found. Is there a way to do it or do i have to use intent receivers in such a situation?
wonderoid
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Feb 16, 2008 10:33 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 13 guests