Search in sources :

Example 1 with DBHelper

use of com.a5corp.weather.preferences.DBHelper in project Weather by Sparker0i.

the class WeatherActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_weather);
    Log.i("Activity", WeatherActivity.class.getSimpleName());
    mManager = NotificationManagerCompat.from(this);
    preferences = new Prefs(this);
    toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    fab = findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            hideFab();
            showInputDialog();
        }
    });
    Intent intent = getIntent();
    handler = new Handler();
    fab.show();
    wf = new WeatherFragment();
    Bundle bundle = new Bundle();
    bundle.putInt("mode", intent.getIntExtra(Constants.MODE, 0));
    wf.setArguments(bundle);
    gf = new GraphsFragment();
    // mf = new MapsFragment();
    dbHelper = new DBHelper(this);
    getSupportFragmentManager().beginTransaction().replace(R.id.fragment, wf).commit();
    initDrawer();
    NotificationService.enqueueWork(this, new Intent(this, WeatherActivity.class));
}
Also used : Bundle(android.os.Bundle) DBHelper(com.a5corp.weather.preferences.DBHelper) Handler(android.os.Handler) Intent(android.content.Intent) WeatherFragment(com.a5corp.weather.fragment.WeatherFragment) Prefs(com.a5corp.weather.preferences.Prefs) View(android.view.View) GraphsFragment(com.a5corp.weather.fragment.GraphsFragment)

Aggregations

Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 Handler (android.os.Handler)1 View (android.view.View)1 GraphsFragment (com.a5corp.weather.fragment.GraphsFragment)1 WeatherFragment (com.a5corp.weather.fragment.WeatherFragment)1 DBHelper (com.a5corp.weather.preferences.DBHelper)1 Prefs (com.a5corp.weather.preferences.Prefs)1