tags:

views:

138

answers:

1

Hi,

In my android project, I have 2 Activities. How can I launch an Activity from an Activity. I know I can do 'startActivity', but my activity has NOT registered for any Intent, is there anyway I can still launch it from my activity?

Thank you.

+2  A: 
startActivity(new Intent(this, MyOtherActivity.class));
CommonsWare
Just as a follow-up, generally the "android way" is to implement anonymous inner classes for things such as button click handlers and other things of that nature. In those cases a simple "this" will cause an error. I forced myself to get in the habit of typing the name of the class I was currently in and then "this", so if I was starting an activity from "MyMainActivity" it would read like this:startActivity(new Intent(MyMainActivity.this, MyOtherActivity.class));
MattC
Also note, you won't have to list an intent filter for it, but it'll still have to be listed in the manifest.
fiXedd