gpt4 book ai didi

java - 单击时微调器崩溃

转载 作者:行者123 更新时间:2023-11-29 19:09:10 28 4
gpt4 key购买 nike

我正在使用 Android-Studio

经过几天的编码,我正在创建一个运行良好的应用程序

我的微调器完全坏了!....我不认为这是因为其他代码?

当我点击它时,应用程序崩溃了...

这是我的 Spinner 代码:

          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:.....这重要吗?...

   <Spinner
android:id="@+id/cater"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="@+id/textView2" />

登录目录:

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

它甚至不说 *Example* Stoped working 它会立即退出...

Full Xml

Full Code

我尝试过的事情

清理项目...

最佳答案

检查样式清理项目并构建

关于java - 单击时微调器崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46013421/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com