• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Hello World application not showing

Hi guys

Sorry to bore you with a 'Hello World' question. The problem is I can't get my application to show 'Hello World'. My emulator loads fine and the device is started. From here i drag the locked icon across which takes me to the main screen but it doesn't have hello world anywhere.

I searched everywhere for a solution and still can't do a basic hello world application. Any help I will vastly appreciate.

Code:
package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
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);

        TextView tv = new TextView(this);
        tv.setText("Hello, Android");
        setContentView(tv);
    }
}
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones