launch android activity from non-activity class
- by Alberto Barrera
im New on Android. I know theres a lot of similar Questions but anyone is helping.
Im using a 3rd party app that just launch a class that extends their own class.
So from that class i would like to launch an activity.
public class SkyTest extends VtiUserExit {
@Override
public VtiUserExitResult execute() throws VtiExitException {
// TODO Auto-generated method stub
logInfo("TEST");
return null;
}
}
How do i launch an activity named MainActivity from here.
i tryed this:
Context context = null;
Intent intent = new Intent(context, MainActivity.class);
context.startActivity(intent);
but its not working, i know i cant use the null context, but how do i create a context o how it works?
Thanks