btw i am just learning so bear with me ive got all my code correct as far as i can tell my main.xml reads
<Button
android:id="@+id/LOGIN"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/LOGIN"
android:textSize="25dp"
android:background="@drawable/custombutton"/>
custombutton.xml
<item
android:state_pressed="true"
android:drawable="@drawable/musicnotes1"/>
<item
android:state_focused="true"
android:drawable="@drawable/musicnotes2"/>
created a custombutton.java
import android.app.Activity;
import android.os.Bundle;
public class custombutton extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.drawable.custombutton);
}
}
and I have the android manifest correct as well no errors showing why is my button gone?
You are setting your content view to be
R.drawable.custombuttonwhen it should beR.layout.mainFor example:
should be:
Also, you posted your main.xml source but be sure that your button is inside of a layout.
For example:
And your background drawable selector should be wrap in a selector like this:
Perhaps you are forgetting to have a default image?