Tuesday, April 30, 2013

[android help] android:background don't work except for overview


I work on an Android application, and I just try to put a background on an empty activity by way of welcome in the application. In the overview of the xml file, the image is displayed, but when i try the app on the emulator or on my phone, she's not displayed. They have no error, I don't understand. Can someone help me please ?



public class MainActivity extends Activity {

private SQLiteDatabase db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Intent i = new Intent(this, ListeContact.class);
try
{
Thread.sleep(3000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
startActivity(i);
this.finish();
}
}


activity_main.xml :




android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/fond">



P.S. My image named fond.png is on 5 folder named drawable-hdpi, drawable-ldpi, drawable-mdpi, drawable-xdpi and drawable-xxdpi.



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...