@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.file_path); setTitle(R.string.file_path_example); final Preferences preferences = Preferences.getInstance(getContext()); mFilePathText = (EditText) findViewById(R.id.file_path); mFilePathText.setText(preferences.getCustomFilePath(mTimeIndex)); ((Button) findViewById(R.id.save_settings)) .setOnClickListener( new Button.OnClickListener() { public void onClick(View v) { preferences.setCustomFilePath(mFilePathText.getText().toString()); dismiss(); } }); ((Button) findViewById(R.id.reset_settings)) .setOnClickListener( new Button.OnClickListener() { public void onClick(View v) { mFilePathText.setText(""); } }); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPreferences = Preferences.getInstance(this); LocaleManager.getInstance(this, true); setContentView(R.layout.activity_muazzin); final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); assert toolbar != null; toolbar.setTitle(R.string.app_name); setSupportActionBar(toolbar); // Set up the ViewPager, attaching the adapter MuazzinAdapter muazzinAdapter = new MuazzinAdapter(getApplicationContext(), getSupportFragmentManager()); ViewPager pager = (ViewPager) findViewById(R.id.pager); assert pager != null; pager.setAdapter(muazzinAdapter); final SlidingTabLayout indicator = (SlidingTabLayout) findViewById(R.id.indicator); assert indicator != null; indicator.setViewPager(pager); }