I have an Activity class.
public class A extends Activity
{
}
Then I have a class that is not an Activity but I want it to start the Activity A.
public class B
{
public B()
{
Intent I = new Intent(null, A.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
}
The code is take from this question which should work: Calling startActivity() from outside of an Activity?
However, when I run it I never change from my first activity to activity A. What am I doing wrong? Should I be listening to the FLAG_ACTIVITY_NEW_TASK inside A?