2017-09-02 113 views
1

我使用Android-Studio微調崩潰上點擊

我創建一個應用程序它編碼

我的飛旋的做工精細,幾天後,就徹底打破! ....我不認爲這是因爲其他代碼?

當我點擊它應用程序崩潰...

這裏是我的微調代碼:

  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) { 

      } 
     }); 

微調X​​ML:.....關係呢...

<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 

它甚至dosent說*Example* Stoped working它會立即退出......

Full Xml

Full Code

事情我想

清理項目...

+0

您是否使用style.xml中的任何樣式作爲該佈局中的微調器或其他視圖 –

+0

Full Logcat:https://pastebin.com/k4MJNH7T – Disco4uf

+0

android:theme =「@ android:style/TextAppearance.Material」 嘗試刪除這 –

回答

1

檢查風格乾淨項目build it

+0

他們,這是我想我曾經告訴過的問題? :D – Disco4uf

+0

點擊File-Invalid Cashes/Restart在備份您的整個應用程序之前 –

+0

另請參閱此鏈接https://stackoverflow.com/questions/33283105/too-many-attribute-references-warning-possible-causes –

0

此代碼是在我的設備上工作。如果您使用的是Android Studio: Goto 「Build」 menu並選擇「Clean Project」然後嘗試運行它。

+0

等待,要添加完整的代碼導致清潔dosent工作。 – Disco4uf

+0

以及我不能粘貼代碼在這裏,我可以看到你的代碼? – Disco4uf

+0

https://codeshare.io/2KgKk7 –

0

我在風格android:theme="@android:style/TextAppearance.Material" 一些地方

我刪除它工作得很好......

由於維卡斯·庫馬爾