Code example for Fragment

Methods: getActivityonActivityCreatedstartActivity

18
		return inflater.inflate(R.layout.splash, container, false);
	} 
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		/* Found credentials, forwarding to BrowsingActivity */ 
		SharedPreferences prefs = SettingsActivity.getSettings(getActivity());
		if (prefs.contains("ident")) {
			Intent browseData = new Intent(getActivity(), BrowsingActivity.class);
			String serverUrl = prefs.getString("serverUrl", "");
			browseData.putExtra("url", serverUrl + "/api/getFolderList");
			startActivity(browseData);
		} 
	} 
 
}