2017-02-16 83 views
0

我正在顯示與虛擬數據課程列表。我正在使用自定義 佈局來顯示課程。從服務器獲取對象列表。 在調試模式下或在設備上運行應用程序 時,一切正常。Android列表查看數據不顯示在生產模式APK

現在,當我建立生產模式簽署APK列表 的數據顯示不出來。數據來自服務器,也是成功映射到列表中的 。但它沒有出現。

enter image description here

這裏是我的自定義佈局文件的代碼。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content"> 
<TextView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/tvCourseName" 
    android:gravity="center" 
    android:textSize="22sp" 
    android:layout_marginStart="15dp" 
    android:layout_marginEnd="15dp" 
    android:layout_marginTop="5dp" 
    android:layout_marginBottom="5dp" 
    android:textColor="@color/main" 
    android:background="@drawable/background_course_name" 
    android:text="@string/english"/> 
</RelativeLayout> 

這裏是適配器的代碼。

public View getView(int position, View convertView, ViewGroup parent) { 

    LayoutInflater inflater = LayoutInflater.from(getContext()); 
    View view = inflater.inflate(R.layout.course_row_layout,parent,false); 

    response = getItem(position); 

    tvCourseName = (TextView)view.findViewById(R.id.tvCourseName); 
    tvCourseName.setText(response.getTitle()); 

    return view; 
} 
+1

發表您的logcat和gradle這個文件,彩色文件也 –

+0

編輯你的問題,並提供必要的文件 –

+0

的http://計算器。 com/questions/31590714/getcolorint-id-deprecated-on-android-6-0-marshmallow-api-23 –

回答

0

如果您認爲您沒有在源代碼改變什麼,並且只在發佈版本中出現,請檢查您的progaurd文件。 在發佈版本中嘗試diable progaurd

在gradle文件中放置minifyEnabled false,然後查看發生了什麼。

如果它是由progaurd造成的,儘量保持你的實體類或自定義視圖從混淆

+0

讓我看看.. –