2014-11-05 120 views
0

在我的應用程序中,我有一個Fragment類的Facebook login.I想從類Activity類中獲得此類充氣佈局,以便我可以在SideMenu中顯示facebook數據。如何在Activity類中獲取佈局?將數據從片段傳遞到活動?

這是我的onCreate方法

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 
{ 
fa = super.getActivity(); 
ll = (LinearLayout) inflater.inflate(R.layout.login_notifications, container, false); 
login(); 
return ll; 
} 
+0

http://stackoverflow.com/questions/14439941/passing-data-between -fragments到活動 – 2014-11-05 10:59:51

回答

0

這是用於示出片段佈局的代碼: -

private static View rootView; 

@Override 

    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) { 


    rootView = inflater.inflate(R.layout.location_layout, container,false); 

    return rootView; 

}