TestAndroid.java
----
package com.test.TestAndroidPackage;
import android.app.Activity;
import android.os.Bundle;
public class TestAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
----
button_selector.xml
----
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button_selector_normal" />
<item android:state_active="true" android:drawable="@drawable/
button_selector_focused" />
<item android:state_enabled="true" android:drawable="@drawable/
button_selector_focused" />
<item android:state_focused="true" android:drawable="@drawable/
button_selector_focused" />
<item android:state_pressed="true" android:drawable="@drawable/
button_selector_focused" />
<item android:state_selected="true" android:drawable="@drawable/
button_selector_focused" />
<item android:state_window_focused="true"
android:drawable="@drawable/button_selector_focused" />
</selector>
----
main.xml
----
<?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">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_selector"
android:text="button1"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="button2"/>
</LinearLayout>
----
AndroidManifest.xml
----
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.TestAndroidPackage"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<activity android:name=".TestAndroid"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
manifest>
----
Files button_selector_focused.png, button_selector_normal.png,
icon.png, strings.xml, default.properties
No matter what i do, the button_selector_focused.png will never show
up on button1 --
why doesn't this work?
tia.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---