I create an Intent in one class then it’s returned to another class. I need to check the type of intent it is. I need to ensure it’s not a specific class of intent.
How to do this?
if( newIntent == ActivityName.class )
Edit:
So I would need to know if the new intent would equal an intent of a certain type:
newIntent = new Intent(context, ActivityName.class);
return newIntent;
In another class:
if( newIntent == ActivityName.class ) // do something
Hope this clarifies a bit.
If you’re just trying to check what type the intent is (or any java object for that matter) use
However, I suspect this isn’t what you’re actually looking to do. Regardless of what activity you create an
Intentin, it is always an instance of theIntentclass. That is, of course, unless you have explicitly created a subclass of theIntentclass. Can you tell us a little more about what you’re trying to do?