Android Open Source - Alkomer Base Activity






From Project

Back to project page Alkomer.

License

The source code is released under:

MIT License

If you think the Android project Alkomer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package cz.jmx.tomik.alkomer.android;
/*  w w  w.j a v a 2s.co m*/
import cz.jmx.tomik.alkomer.android.models.User;
import cz.jmx.tomik.alkomer.android.threads.UpdateSettingsThread;
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

/**
 * Alkomer - Server App
 * --------------------
 * BaseActivity
 *
 * @copyright   Copyright (c) 2011 Tomas Vitek
 * @author      Tomas Vitek ~ http://tomik.jmx.cz

 * @package     Alkomer
 * @version     1.0
 */
public class BaseActivity extends Activity implements OnSharedPreferenceChangeListener {
    protected TextView title;
    protected ImageView logo;
 
    @Override
    public void onCreate(Bundle savedInstanceState) {        
      requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
      
      super.onCreate(savedInstanceState); 
         
        setContentView(R.layout.main); 
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.titlebar);
 
        title = (TextView) findViewById(R.id.title);
        logo = (ImageView) findViewById(R.id.logo);
        
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        prefs.registerOnSharedPreferenceChangeListener(this);
    }

  @Override
  public void onSharedPreferenceChanged(SharedPreferences arg0, String arg1) {
    new Thread(new UpdateSettingsThread(getApplicationContext(), new User(getApplicationContext()))).start();    
  }
}




Java Source Code List

cz.jmx.tomik.alkomer.android.BaseActivity.java
cz.jmx.tomik.alkomer.android.DashboardActivity.java
cz.jmx.tomik.alkomer.android.DrinkListActivity.java
cz.jmx.tomik.alkomer.android.ForgottenPasswordActivity.java
cz.jmx.tomik.alkomer.android.GlassListActivity.java
cz.jmx.tomik.alkomer.android.LoginActivity.java
cz.jmx.tomik.alkomer.android.Main.java
cz.jmx.tomik.alkomer.android.RegistrationActivity.java
cz.jmx.tomik.alkomer.android.SettingsActivity.java
cz.jmx.tomik.alkomer.android.StatisticsActivity.java
cz.jmx.tomik.alkomer.android.StatisticsFlowAdapter.java
cz.jmx.tomik.alkomer.android.database.DataHelper.java
cz.jmx.tomik.alkomer.android.drinks.DrinkAdapter.java
cz.jmx.tomik.alkomer.android.drinks.Drink.java
cz.jmx.tomik.alkomer.android.drinks.Drinks.java
cz.jmx.tomik.alkomer.android.drinks.GlassAdapter.java
cz.jmx.tomik.alkomer.android.drinks.Glass.java
cz.jmx.tomik.alkomer.android.models.Gender.java
cz.jmx.tomik.alkomer.android.models.User.java
cz.jmx.tomik.alkomer.android.threads.DeleteDrinkThread.java
cz.jmx.tomik.alkomer.android.threads.DeleteDrinksThread.java
cz.jmx.tomik.alkomer.android.threads.DrinkThread.java
cz.jmx.tomik.alkomer.android.threads.ForgottenPasswordAsyncTask.java
cz.jmx.tomik.alkomer.android.threads.ImageDownloadAsyncTask.java
cz.jmx.tomik.alkomer.android.threads.LoginAsyncTask.java
cz.jmx.tomik.alkomer.android.threads.RegistrationAsyncTask.java
cz.jmx.tomik.alkomer.android.threads.UpdateSettingsThread.java
cz.jmx.tomik.alkomer.android.tools.Calculator.java
cz.jmx.tomik.alkomer.android.tools.DataTime.java
cz.jmx.tomik.alkomer.android.tools.EmailValidator.java
cz.jmx.tomik.alkomer.android.tools.IntEditTextPreference.java