I’m following the android developer tutorials on tab layouts.
(im very very new to android)
I dont have errors, but when I run it I get an activity not found exception.
The ddms asks if ive added the artists activity to the android manifest file, which I have.
in the tutorial – http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
it says :
“Notice that the TabWidget and the FrameLayout elements have the IDs tabs and tabcontent, respectively. These names must be used so that the TabHost can retrieve references to each of them. It expects exactly these names”
Where should I specify those names exactly. I know the id’s need to be linked, but I dont know where to do it.
I would actually recommend that you stop following this sample code as it is using an old of way of doing what you want with tabs.
I would instead recommend that you start reading about
ViewPager. I would start by reading http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.htmlYou’ll want to get the Android Support/Compatibility Library plus the Support Demos and look at the source code inside. In particular, you’ll want to pay close attention to http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabsPager.html
With FragmentTabsPager, you’ll be using the latest techniques and have the best of both worlds: tabs as well as horizontal swiping. Google recommends using Fragments going forward for UIs like this. You can read more about Fragments at http://developer.android.com/guide/topics/fundamentals/fragments.html