tags:

views:

39

answers:

1

I had come across a code snippet which calls for an activity without referring to any context. Before, i was considering that context is used to tell about the calling component. But as i came see that another component can be called without any reference to context, it makes me wonder what purpose it might be serving. please put some light on it.

Here is the code which calls for an activity without referring to 'context'

Intent i=new Intent();
ComponentName cn=new ComponentName("application package name","fully qualified class name");
i.setComponent(cn);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);