내 안드로이드 앱에서 탐색 서랍을하고 있습니다. 내 onNavigationDrawerItemSelected
함수에서 나는 현재 조각을 새로운 것으로 바꾸기 위해 item select를 시도한다. 문제는 내가 현재 조각을 바꿀 때 그것의 초기 상태를 취한다는 것이다. 어쩌면 내가 이런 식으로하고 있기 때문에 fragmentManager.beginTransaction() .replace(R.id.cont, new SessionsFragement()) .commit();
나는 내 조각의 새로운 인스턴스를 선언하고 그것은 정상적인 것 같아, 그 물건의 초기 상태를 표시합니다. 내 조각에 내가 그쪽으로 네가 네비게이션 서랍에서 조각을 호출 할 때 그것을 말할 것이라고 보려면 textView 설정할 시도했다 그러나 그것은 사실이 아니야.대체 할 올바른 조각을 설정하는 방법.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_spot, container, false);
tata = (TextView) v.findViewById(R.id.tata);
tata.setText("karim");
return inflater.inflate(R.layout.fragment_spot, container, false);
}
제발 누구든지이 문제를 해결할 수 있도록 도와주세요.
덕분에 많은 도움이되었습니다. –