Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7990659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:04:53+00:00 2026-06-04T13:04:53+00:00

I already tried asking this question at Relative layout Coding , but that first

  • 0

I already tried asking this question at Relative layout Coding, but that first attempt was not very clear.

I would like to create a relative layout over GLSurfaceView but the layout must look like this:

<RelativeLayout
        android:id="@+id/View1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@raw/gi"
        android:orientation="vertical" >

        <ImageView
                android:id="@+id/imageView1"
                android:layout_width="64px"
                android:layout_height="64px"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:src="@drawable/b1" />

        <ImageView
                android:id="@+id/imageView2"
                android:layout_width="64px"
                android:layout_height="64px"
                android:layout_alignParentTop="true"
                android:layout_toRightOf="@+id/imageView1"
                android:src="@drawable/b2" />

        <ImageView
                android:id="@+id/imageView3"
                android:layout_width="64px"
                android:layout_height="64px"
                android:layout_alignParentTop="true"
                android:layout_toRightOf="@+id/imageView2"
                android:src="@drawable/b3" />
</RelativeLayout>

However, if I code it like they say in the answers it works but the images are still put on top of each other. (I used the getId functions to addrules)

So I’m thinking of adding the whole xml file and work that way but any time I load an xml the app stops. Here’s most of the code:

public class HelloWorld extends Activity {
...
protected void onCreate(Bundle savedInstanceState) {
    ....
    opengl = new GLSurfaceView(getApplication());
    opengl.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
        public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
              int[] attributes = new int[] { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE};
              EGLConfig[] configs = new EGLConfig[1];
              int[] result = new int[1];
              egl.eglChooseConfig(display, attributes, configs, 1, result);
              return configs[0];
        }
    });

    renderer = new MyRenderer();
    mGLView.setRenderer(renderer);
    setContentView(opengl);
    addContentView(findViewById(R.id.View1), new RelativeLayout.LayoutParams(
              RelativeLayout.LayoutParams.FILL_PARENT,
              RelativeLayout.LayoutParams.FILL_PARENT));

Bear in mind that without the last call to addContentView the app works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:04:55+00:00Added an answer on June 4, 2026 at 1:04 pm

    It looks like I’m gonna answer my own question.

    instead of addcontentview i added the following

    gi=new RelativeLayout(this);
                    View view; 
            LayoutInflater inflater = (LayoutInflater)   getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
            view = inflater.inflate(R.layout.gi, null);
            hud.addView(view);
            addContentView(gi, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
    

    and as such I succeded in adding a whole xml file above the glsurface view.

    But I am wondering now on how to get an id of each child in r.layout.gi. Let’s say I want to change a picture of R.id.imageView1 ??????????????

    Does Anybody know how to do this with the current code?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried to find this already but can't find any questions which are asking quite
I've tried many functions already, but I simply can't figure this out. The right
I have already asked this question on ServerFault however I got very minimal replies....one
I'm not sure if I'm even asking this question correctly. I just built my
I have resisted asking this seemingly n00b question, but all my recent effort to
Maybe the question isn't that clear, but with an example, I guess I'll clear
I've tried my darnest to avoid asking this question (I viewed and try a
This question might seem stupid but i nonetheless i believe it's a worth asking
Eclipse does not highlight matching variables for me: I've already tried to change Mark
I'm wondering whether an object asking a question to another object that indirectly holds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.