Android Community
Results 1 to 2 of 2

Thread: Using Android tabs with views instead of activities

  1. #1
    Join Date
    Jul 2011
    Posts
    2

    Default Using Android tabs with views instead of activities


    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?

  2. #2
    Join Date
    Jul 2011
    Posts
    2

    Default Re: Using Android tabs with views instead of activities


    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

Similar Threads

  1. Passing data between Activities
    By bsteer in forum Developers Guild
    Replies: 0
    Last Post: 11-11-2010, 08:20 AM
  2. Question about Lists and Views
    By rappa819 in forum Developers Guild
    Replies: 0
    Last Post: 08-30-2010, 11:16 PM
  3. Track System Activities
    By ernandes in forum Developers Guild
    Replies: 0
    Last Post: 12-14-2009, 02:09 PM
  4. Replies: 22
    Last Post: 12-20-2008, 10:39 AM
  5. Funny Google Gtreet Views
    By Post-it™ in forum General Phone Chat
    Replies: 4
    Last Post: 12-10-2008, 08:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •