Hi!

Why doesn't write this program "Hello World! :-)" on my screen?
I know how I would do it with an xml-file, but I want to do it like
in the following program.
And how can I set the coordinates without setting the width and height
like with tv.layout(10,10,100,100); ?

Greetings, Martin

-----------------------------------------------------------------------

package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.widget.AbsoluteLayout;
import android.widget.TextView;


public class HelloAndroid extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       AbsoluteLayout layout = new AbsoluteLayout(this);
       TextView tv = new TextView(layout.getContext());
       tv.layout(10,10,100,100);

       tv.setText("Hello World! :-)");
       setContentView(layout);
   }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to