In the developer.android.com Tab Layout tutorial, it said that you can use tabs to swap views within the same activity, or you can use tabs to change between entirely separate activities. But it doesn't mention how to swap views in the same activity, so I tried to research how to do that. I came across this example:
https://github.com/commonsguy/cw-and...ster/Fancy/Tab
It made sense to me and I followed that approach in my application, but when I ran it in my emulator, it said my application had stopped unexpectedly, please try again. I wanted to know where the error was coming from, so I ran it in debugger mode. In the middle of the screen in Eclipse, under the tab ActivityThread.performLaunchActivity(...), all it said was "source not found" in red, and a button saying edit source lookup path. In the console tab near the bottom, it said:
[2011-07-04 19:00:08 - Logcat]device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.j ava:736)
at com.android.ddmlib.AdbHelper.executeRemoteCommand( AdbHelper.java:373)
at com.android.ddmlib.Device.executeShellCommand(Devi ce.java:284)
at com.android.ddmuilib.logcat.LogPanel$3.run(LogPane l.java:527)
Does anyone know what I did wrong?
I didn't find out why my application wasn't working, but I copied all the code from that example site into a test project I made and I got it to work. As I was changing the test project, I found out that not all of the UI from the main.xml file gets shown when I ran the application. I have a LinearLayout with vertical orientation, and LinearLayouts inside that one that all have horizontal orientation. Only the first child LinearLayout gets shown on the screen.
Here is the code from my main.xml file, the TestProjectActivity.java class, and the picture of what shows up:
https://docs.google.com/document/d/1.../edit?hl=en_US
https://docs.google.com/document/d/1.../edit?hl=en_US
https://profiles.google.com/Needham....0270146?tab=qh
Bookmarks