After solving the problem with the invisible ArrayList, the next
problem occurred. Situation is still the same:

There are two Activities (Activity A and B). At Activity A I customize
a button and pass it on Activity B via an intent. On Activity B I move
the button somewhere on the screen. This
will be done with other buttons. On Activity B I also want to show the
old Buttons.

Thats the code:

         if(keyList.isEmpty() == false){
                        for (iter = keyList.iterator(); iter.hasNext();){

                                Button k =  (Button) iter.next();
                                Button ok = new Button(this);

                                ok.setHeight(k.getHeight());
                                Log.i("Button K", "Height: " + k.getHeight());
                                Log.i("Button OK", "Height: " + ok.getHeight());

                                ok.setWidth(k.getWidth());
                                ok.setText(k.getText());
                                ok.layout(k.getLeft(), k.getTop(), 
k.getRight(), k.getBottom
());
                                ok.setVisibility(1);

                                rel_layout.removeView(ok);
                                rel_layout.addView(ok);

           }

But there are two problems:
1. The properties are not set properly
With
  ok.setHeight(k.getHeight());
        Log.i("Button K", "Height: " + k.getHeight());
        Log.i("Button OK", "Height: " + ok.getHeight());

I get
  Button K Height = 48
  Button OK Height = 0

At my Activity it is set correctly but here...

2. As above mentioned, I want to move the Buttons and set them
somewhere on the screen (e.g. down right). But everytime I call
Acitvity B again, all Buttons are located at top left.
I thought it would be achieved with
  ok.layout(k.getLeft(), k.getTop(), k.getRight(), k.getBottom());

But obviously not.


Any suggestion and hints how this could be solved would be
appreciated !

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to