1. Are you ready for the Galaxy S20? Here is everything we know so far!

Apps Eclipse : Link a layer in XML and then to the activity Help

Discussion in 'Android Development' started by Lomo133, Aug 4, 2013.

  1. Lomo133

    Lomo133 Lurker
    Thread Starter

    Hey everyone!

    I am pretty new to programming with Eclipse and i'm currently developing a game
    and then I got stuck with a problem.

    I link the relative layout to the XML game and assign it a ID, and then how do I add it to the activty ? :thinking: Is there a command to do so it appears in the activity or something?

    This maybe sounded very weird but if there is someone with a clue about this I would GREATLY apperciate it. If someone feels very kind and is experianced I could give more information if needed.

    // Lomo ;)
     

    Advertisement

  2. Calc

    Calc Member

    setContentView(R.layout.yourlayout);
     
  3. Lomo133

    Lomo133 Lurker
    Thread Starter

    Yes I already have that,

    It's like this
    setContentView(R.layout.game);

    Because the XML's name is Game.

    But the problem is that when i Assign a ID to the relativ layout I dont know how I can link it below the setContentView(R.layout.game);

    Is there a command to link it in the activity?
     
  4. out of ideas

    out of ideas Android Enthusiast

    when you set the contentview, its attaches the whole xml to your activity.

    what exaclty are you trying to do?
     
  5. Calc

    Calc Member

    How do you assign ID?
     
  6. Lomo133

    Lomo133 Lurker
    Thread Starter

    It is suppose to happen something under the setContentView(R.layout.game); In the activity when I Assign the ID in the XML, but nothing happens??

    I don't even know if it will happen automaticly or if I have to press some buttons because nothing happens? It wont happen something under the setContentView(R.layout.game);
    and It's so hard to explain more. :(
     
  7. Lomo133

    Lomo133 Lurker
    Thread Starter

    I assign the ID by right clicking the relativ layout thing to the right In the XML.
     
  8. Lomo133

    Lomo133 Lurker
    Thread Starter

    Is people not able to help now? Because suddenly now nobody writes something, If you need more information I can try to do that but I need to know what you need help with :( Please community try to help me :(((
     
Loading...
Similar Threads - Eclipse Link layer
  1. Cyberdev
    Replies:
    0
    Views:
    159
  2. Cyberdev
    Replies:
    0
    Views:
    107
  3. Cyberdev
    Replies:
    0
    Views:
    98
  4. Cyberdev
    Replies:
    1
    Views:
    2,388
  5. Cyberdev
    Replies:
    1
    Views:
    1,033
  6. Cyberdev
    Replies:
    4
    Views:
    1,389
  7. Cyberdev
    Replies:
    15
    Views:
    11,910
  8. Cyberdev
    Replies:
    5
    Views:
    5,925
  9. Cyberdev
    Replies:
    1
    Views:
    2,013
  10. Cyberdev
    Replies:
    0
    Views:
    195

Share This Page

Loading...