1. Create a new android application in Netbeans.
2. Copy your image file to /res/drawable directory
(Note: Name of image file should be in small letter)

3 Open main.xml file and add following line to it.
android:background="@drawable/hd_bg"
Here "hd_bg" is image file name without extension.
Your main.xml file should look like this.

2. Copy your image file to /res/drawable directory
(Note: Name of image file should be in small letter)

3 Open main.xml file and add following line to it.
android:background="@drawable/hd_bg"
Here "hd_bg" is image file name without extension.
Your main.xml file should look like this.
Save and run application.<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"android:background="@drawable/hd_bg"><TextViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:text="Hello World, MainActivity"/></LinearLayout>
No comments:
Post a Comment