2016-08-04 81 views
0

我正在Android Studio中處理Android應用程序,並需要使用xml文件向項目添加動畫。因此,我創建了一個res/animator目錄,並在其中放入了一個文件所謂pulsation.xml,它什麼也不做,這裏的代碼:在Android Studio中創建animator文件塊應用程序

<?xml version="1.0" encoding="utf-8"?> 
<set xmlns:android="http://schemas.android.com/apk/res/android"android:ordering="together"> 
</set> 

內的活動,應用程序訪問存儲在SharedPreferences物體而運行的應用程序一定的價值,而不pulsation.xml文件在res/animator目錄中時,程序檢索所需的值時沒有問題,當將.xml裏面的文件res/animator該程序不能檢索任何東西。我無法理解這種奇怪的行爲來自何處。這裏應用程序從SharedPreferences對象中檢索數據的代碼片段:

SharedPreferences pref = getSharedPreferences("ballan.emmanuele.hellpuzzle.PUNTEGGI",MODE_PRIVATE); 
     SharedPreferences.Editor editor = pref.edit(); 
    do 
      { 
next = pref.getInt(R.id.liv1+"next",R.id.liv2); 
       TextView punt = (TextView) findViewById(pref.getInt(next+"punt",R.id.punt1)); 
       punt.setText(pref.getInt(next+"punteggio",0)+""); 
       TextView num = (TextView) findViewById(pref.getInt(next+"num",R.id.num1)); 
       num.setText(pref.getInt(next+"numero_sequenza",0)+""); 
       LinearLayout lay =(LinearLayout)findViewById(pref.getInt(next+"riga",R.id.riga1)); 
       lay.setVisibility(View.VISIBLE); 
      }while (next != ultimo); 

我將最小SDK版本設置爲11.謝謝您的幫助。

+0

你的意思是'res/anim'目錄? – Shaishav

+0

在屬性動畫目錄的$ res/animator目錄中 – Emmanuele

+0

哦......我瘋了......道歉! – Shaishav

回答

0

我發現問題包括與Nexus S Api 23.使用此模擬器該程序仍然無法正常工作,更改模擬器或使用我的三星或其他Nexus模擬器手機應用程序不打擾。

相關問題