Results 1 to 7 of 7
  1. #1
    droidus is offline Senior Member
    Join Date
    Feb 2011
    Posts
    244
    Rep Power
    4

    Default starting a new activity

    I am trying to start a new activity within the same app. I have the following in my main activity:

    Java Code:
    Intent intent = new Intent(MainActivity.this, screen2.class);
    startActivity(intent);
    I also added the following line to my manifest file:
    Java Code:
    <activity android:name=".screen2" />
    It seems to force close when the code is executed though.

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: starting a new activity

    What's the stack trace say?
    Get in the habit of using standard Java naming conventions!

  3. #3
    droidus is offline Senior Member
    Join Date
    Feb 2011
    Posts
    244
    Rep Power
    4

    Default Re: starting a new activity

    I have included a screenshot of the logcat.
    Attached Thumbnails Attached Thumbnails starting a new activity-android.png  

  4. #4
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: starting a new activity

    The "caused by" line two lines up from the cursor suggests that your screen2 class doesn't extend Activity.

    BTW, posting text is much preferred over screenshots.
    Get in the habit of using standard Java naming conventions!

  5. #5
    droidus is offline Senior Member
    Join Date
    Feb 2011
    Posts
    244
    Rep Power
    4

    Default Re: starting a new activity

    how do i get it as text?

  6. #6
    droidus is offline Senior Member
    Join Date
    Feb 2011
    Posts
    244
    Rep Power
    4

    Default Re: starting a new activity

    I getting another error. This happens before the vd even starts up:

    Java Code:
    Invalid layout of java.lang.String at value
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  Internal Error (javaClasses.cpp:129), pid=6680, tid=7012
    #  fatal error: Invalid layout of preloaded class

  7. #7
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: starting a new activity

    If you're using Eclipse, just select and copy from the LogCat window. There isn't a "copy" option in the context menu, but Ctrl-C (or Apple-C) works.

    I have no idea about that second error.
    Get in the habit of using standard Java naming conventions!

Similar Threads

  1. Activity Manager 0.4.2
    By java software in forum Java Software
    Replies: 0
    Last Post: 01-27-2013, 03:31 AM
  2. Replies: 5
    Last Post: 09-19-2012, 09:58 AM
  3. Replies: 0
    Last Post: 10-01-2011, 05:14 AM
  4. Replies: 1
    Last Post: 09-12-2011, 03:09 AM

Posting Permissions

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