Android service onCreate is called multiple times without calling onDestroy

I had the same problem when my service used the same process with activities(default). but no more problems when I made my service use another process. I edited my AndroidManifest.xml like below… (added android:process attribute) <service android:name=”kr.co.pkbio.binoo.CacheFileManagerService” android:process=”:kr.co.pkbio.binoo.service”/> <service android:name=”kr.co.pkbio.binoo.ActivityStackManagerService” android:process=”:kr.co.pkbio.binoo.service”/> see http://developer.android.com/guide/topics/manifest/service-element.html for information.

onCreate flow continues after finish()

I’m guessing that it is because finish() doesn’t cause the onCreate method to return. You could try simply adding finish(); return; Or use an if else @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layoutb); if(good data){ //do stuff }else{ finish(); } }

SQLiteOpenHelper failing to call onCreate?

The onCreate is not a constructor for the database class. It is only called if you try to open a database that does not exist. To open/create the database you need to add a call to one of these methods: public class SmartApp extends Activity implements OnSharedPreferenceChangeListener { private SmartDBHelper dBHelper; public void onCreate(Bundle savedInstanceState) … Read more

Android: When is onCreateOptionsMenu called during Activity lifecycle?

The onCreate method is called first, and before it finishes onCreateOptionsMenu is called. That will be true on devices and apps with an official Honeycomb-style action bar. If there is no action bar, onCreateOptionsMenu() should not get called until the user calls up the menu, typically by pressing the MENU button. (I’m using screen size … Read more