use of android.support.v14.preference.PreferenceFragment in project platform_frameworks_base by android.
the class TunerActivity method onCreate.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getFragmentManager().findFragmentByTag(TAG_TUNER) == null) {
final String action = getIntent().getAction();
boolean showDemoMode = action != null && action.equals("com.android.settings.action.DEMO_MODE");
final PreferenceFragment fragment = showDemoMode ? new DemoModeFragment() : new TunerFragment();
getFragmentManager().beginTransaction().replace(R.id.content_frame, fragment, TAG_TUNER).commit();
}
}
use of android.support.v14.preference.PreferenceFragment in project android_frameworks_base by AOSPA.
the class TunerActivity method onPreferenceStartFragment.
@Override
public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
try {
Class<?> cls = Class.forName(pref.getFragment());
Fragment fragment = (Fragment) cls.newInstance();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
setTitle(pref.getTitle());
transaction.replace(R.id.content_frame, fragment);
transaction.addToBackStack("PreferenceFragment");
transaction.commit();
return true;
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
Log.d("TunerActivity", "Problem launching fragment", e);
return false;
}
}
use of android.support.v14.preference.PreferenceFragment in project platform_frameworks_base by android.
the class TunerActivity method onPreferenceStartFragment.
@Override
public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
try {
Class<?> cls = Class.forName(pref.getFragment());
Fragment fragment = (Fragment) cls.newInstance();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
setTitle(pref.getTitle());
transaction.replace(R.id.content_frame, fragment);
transaction.addToBackStack("PreferenceFragment");
transaction.commit();
return true;
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
Log.d("TunerActivity", "Problem launching fragment", e);
return false;
}
}
use of android.support.v14.preference.PreferenceFragment in project android_frameworks_base by AOSPA.
the class TunerActivity method onCreate.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getFragmentManager().findFragmentByTag(TAG_TUNER) == null) {
final String action = getIntent().getAction();
boolean showDemoMode = action != null && action.equals("com.android.settings.action.DEMO_MODE");
final PreferenceFragment fragment = showDemoMode ? new DemoModeFragment() : new TunerFragment();
getFragmentManager().beginTransaction().replace(R.id.content_frame, fragment, TAG_TUNER).commit();
}
}
use of android.support.v14.preference.PreferenceFragment in project android_frameworks_base by DirtyUnicorns.
the class PNCActivity method onPreferenceStartFragment.
@Override
public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
try {
Class<?> cls = Class.forName(pref.getFragment());
Fragment fragment = (Fragment) cls.newInstance();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
setTitle(pref.getTitle());
transaction.replace(R.id.content_frame, fragment);
transaction.addToBackStack("PreferenceFragment");
transaction.commit();
return true;
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
Log.d("TunerActivity", "Problem launching fragment", e);
return false;
}
}
Aggregations