在上下文中提到

时间:2016-08-24 09:55:23

标签: android android-context

实际上我是从一个片段转到另一个片段,它将异常上下文显示为null。有人有解决方案吗?

dashboard_newrequest_list.setAdapter(new OngingmechanicAdapter(getActivity(),
                                                    Newrequest_Makes_Name,Newrequest_Model_Name,Newrequest_Servicenames,Newrequest_Pknames,Newrequest_Location,Newrequest_order_number,Newrequest_Bookid,Newrequest_Imgpath));

OngingmechanicAdapter

Context con;
 psapplication appication;
public OngingmechanicAdapter(Context con,
                             ArrayList<String> Newrequest_Makes_Name,  ArrayList<String> Newrequest_Model_Name,
                             ArrayList<String> Newrequest_Servicenames, ArrayList<String> Newrequest_Pknames, ArrayList<String> Newrequest_Location,
                             ArrayList<String> Newrequest_Bookid,
                             ArrayList<String> Newrequest_order_number,
                             ArrayList<String> Newrequest_Imgpath
                           ) {


    appication=new psapplication(con);

    this.Newrequest_Makes_Name  = Newrequest_Makes_Name;
    this.Newrequest_Model_Name = Newrequest_Model_Name;
    this.Newrequest_Servicenames = Newrequest_Servicenames;
    this.Newrequest_Pknames = Newrequest_Pknames;
    this.Newrequest_Location = Newrequest_Location;
    this.Newrequest_Bookid = Newrequest_Bookid;
    this.Newrequest_order_number = Newrequest_order_number;
    this.Newrequest_Imgpath = Newrequest_Imgpath;
    this.con = con;
}

0 个答案:

没有答案