斡特法克
2022-05-18 17:02
采纳率: 33.3%
浏览 21
已结题

这个是很奇怪的问题,为什么呢?

 
/*model部分代码*/
public static class A {
   private List<M> m, m1, m2, m3;
   public List<M> getM(int i) {
        switch (i) {
                    case 2:
                        return m2;
                    case 3:
                        return m3;
                    default:
                        return m1;
        }
     }
}
/*model*/
 
/*activity部分代码*/
private List<Pmd.Data.A.M> pmdl1, pmdl2, pmdl3= new ArrayList<>();
 
Pmd ml = gson.fromJson(jsonString, Pmd.class);
pmdl1= ml.getData().getA().getM(1);
pmdl2= ml.getData().getA().getM(2);
pmdl3= ml.getData().getA().getM(3);
 
PMAdapter pmdapter1 = new PMAdapter (pmdl1, PMactivity.this);
/*activity*/
 
/*adapter部分代码*/
private final List<Pmd.Data.A.M> pml;
private final Context PmContext ;
 
public PMAdapter(List<Pmd.Data.A.M> m, Context context) {
    pml= m;
    pmContext  = context;
}
 
/*adapter*/

1条回答 默认 最新

相关推荐 更多相似问题