Android Open Source - AndroidFinally Service On Start Command






From Project

Back to project page AndroidFinally.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidFinally 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 com.example.androidfinallyapp;
/*from  w  w  w.j  a v  a 2 s . com*/
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class ServiceOnStartCommand extends Service {

  private static final String TAG = "ServiceOnStartCommand";

  @Override
  public IBinder onBind(Intent intent) {
    // TODO Auto-generated method stub
    //onBind??unOnBind???????????????????
    Log.i(TAG, "at onBind");
    
    return null;
  }

  @Override
  public void onCreate() {
    // TODO Auto-generated method stub
    //????onBind????onStartCommand????????????onCreate????
    super.onCreate();
    Log.i(TAG, "at onCreate");
  }

  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    // TODO Auto-generated method stub
    //???????????????????,????????????????
    Log.i(TAG, "at onStartCommand");
    return super.onStartCommand(intent, flags, startId);

  }

  @Override
  public void onDestroy() {
    // TODO Auto-generated method stub
    super.onDestroy();
    Log.i(TAG,"at onDestroy");
  }

}




Java Source Code List

com.example.androidfinallyapp.MainActivity.java
com.example.androidfinallyapp.NotificationActivity.java
com.example.androidfinallyapp.ServiceOnBind.java
com.example.androidfinallyapp.ServiceOnStartCommand.java
com.example.androidfinallyapp.SimpleApplication.java
com.example.androidfinallyapp.StartActivity.java
com.example.hellojni.HelloJni.java