2016-08-24 10 views
0

実際には、あるフラグメントから別のフラグメントに移動していて、例外コンテキストがnullとして表示されます。誰にでもこれに対する解決策がありますか?コンテキスト内の相違

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

OngingmechanicAdapter

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

、その後の活動にコンテキストを変更する

Activity con; 

public OngingmechanicAdapter(Activity con,rayList<String.....) { 


    appication=new psapplication(con); 
    // and also make psapplication constructor parameter to Activity 

    this.Newrequest_Makes_Name = Newrequest_Makes_Name; 
    ... 
    this.con = con; 
} 
+0

ITSは、更新答え –

+0

を動作していません –

+0

は再びあなたが気にいらない.....デバッグが欠落している –