开发者

Determine If Current View is a Specific Activity

I am wanting to set an intent on a logo in the titleBar of my application to go back to the main entry screen when clicked unless of course we are already at that screen. How do I go开发者_开发百科 about checking this in an if statement?


Unless I don't understand you correctly, you should just be able to check the class:

if(getClass() == MainActivity.class){

}

Try that and see if it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜