1 /* CampusAppFragment.java
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 package de.dhbwloe.campusapp;
18 import android.os.Bundle;
19 import android.support.v4.app.Fragment;
20 import android.view.View;
22 import java.lang.reflect.Field;
24 import de.dhbwloe.campusapp.search.SearchIndices;
27 * Created by pk910 on 19.01.2016.
29 public abstract class CampusAppFragment extends Fragment {
30 protected CampusAppContext AppContext;
31 protected View oFragmentView;
34 public void onCreate(Bundle savedInstanceState) {
35 AppContext = CampusAppContext.getInstance();
36 super.onCreate(savedInstanceState);
39 public static SearchIndices[] GetSearchIndices() {
40 return new SearchIndices[0];
44 public void onDetach() {
48 Field childFragmentManager = Fragment.class.getDeclaredField("mChildFragmentManager");
49 childFragmentManager.setAccessible(true);
50 childFragmentManager.set(this, null);
52 } catch (NoSuchFieldException e) {
53 throw new RuntimeException(e);
54 } catch (IllegalAccessException e) {
55 throw new RuntimeException(e);