Reputation: 147
I am Using Android-Studio
I was creating an app it was working fine, after few days of coding
my spinner went completely broken ! .... I don't think it's because of other codes?
When I Click on it app crashes...
Here is my Spinner codes :
Spinner s1;
String[] s1c = {"All","Filter1", "Filter2", "Filter3", "Filter4", "Filter5", "Filter6"};
s1 = (Spinner) findViewById(R.id.cater);
ArrayAdapter<String> adapter = new ArrayAdapter<>(this,
android.R.layout.simple_spinner_item, s1c);
s1.setAdapter(adapter);
s1.setSelection(0);s1.setEnabled(true);
s1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
// filter1=s1c[position];
// if(mayload ==1) {
// loadlist();
// }else{
// mayload=1;
// }
/*Even Commented anything....*/
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
Spinner XML : ..... does it matter ?...
<Spinner
android:id="@+id/cater"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="@+id/textView2" />
LogCat :
09-02 16:12:22.603 28394-28394/com.example.discopc.yubismart W/ResourceType: Too many attribute references, stopped at: 0x01010099
09-02 16:12:22.603 28394-28394/com.example.discopc.yubismart W/ResourceType: Too many attribute references, stopped at: 0x0101009a
09-02 16:12:22.603 28394-28394/com.example.discopc.yubismart W/ResourceType: Too many attribute references, stopped at: 0x0101009b
09-02 16:12:22.625 28394-28394/com.example.discopc.yubismart I/Process: Sending signal. PID: 28394 SIG: 9
It dosent even say *Example* Stoped working
it will exit instantly...
Things I tried
Clean Project ...
Upvotes: 1
Views: 823
Reputation: 147
I had a android:theme="@android:style/TextAppearance.Material"
Some where in Styles
I Removed that and it worked fine...
Thanks to vikas kumar
Upvotes: 0
Reputation: 61
This code is working on my device.If you are using Android Studio: Goto "Build" menu and select "Clean Project" and then try running it.
Upvotes: 0