title: Apply Background Image to Listactivty in android
body: <p>This is my android activity which uses a listactivity. I need to give a background image which is located at the res->drawable-hdpi folder. This is Bid_History.java page. In the corresponding activity xml page I have not given any list view. The program works fine without any problem. But I need to set a background to this listactivity .The background image to be used is located in the res->drawable-hdpi folder. I have tried many ways, but still it won't work at all. Can someone please help me in setting a background image for this activity. </p>
  
  <pre><code>package com.example.onlineauction;
  
  import java.text.SimpleDateFormat;
  import java.util.ArrayList;
  
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.app.ListActivity;
  import android.content.Intent;
  import android.database.DataSetObserver;
  import android.util.Log;
  import android.view.Menu;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.ListAdapter;
  import android.widget.ListView;
  import android.widget.Toast;
  
  public class Bid_History extends ListActivity {
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      //setContentView(R.layout.activity_bid__history);
      setListAdapter(new ArrayAdapter&lt;String&gt;(Bid_History.this, android.R.layout.simple_list_item_1,arraydetails));
          //arraydetails is an arraylist which contains the data to be displayed in the listactivity.
           //Data part here. 
  }
  
  
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
      // TODO Auto-generated method stub
      super.onListItemClick(l, v, position, id);
  
     // Data part here
          }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.bid__history, menu);
      return true;
  }
  
  }
  </code></pre>
  
  <p>This is my xml page.</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context=".Bid_History" &gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/hello_world" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>