Hello, I'm trying to understand what exactly is happening in my code. Thanks in advance for replying, I'm pretty confused and need some help. I have read many things on the internet but i havnt found it to be much help.
I have followed an Android tutorial which has created an app with tabs. The code im looking at in particular is this:
andintent = new Intent().setClass(this, AlbumsActivity.class);
I have read that "setContent(Intent) is called to specify the Intent to open the appropriate Activity". I've also read that each activity is a different screen.
When I click on a new tab what exactly am I doing, when I click on a tab everything remains except that the tab I click on stands out (as I clicked on it), so when I click on a tab what is actually happening, am I opening a different activity? If so by opening a different activity what is actually happening? I cant see how I am though because the Activity class which is supposably opening is pretty much blank, all it has in it is a TextView object, so how come the tabs still remain on the screen.
Im confused on what it is to switch to a different Activity, all this time I thought that when you switch Activity, you switch screens, but that cant be seeing as the View objects remain on screen when changing activity :S.
This is the tutorial I've been following: Tab Layout | Android Developers