Activity:
几个重要的函数调用顺序:onCreate()->onStart()->onResum()->onPause()->onStop()->onDestroy()
activity保存和恢复状态:onSaveInstanceStatus();onRestoreInstanceStatus()
setContentView()
(未背)
注册:<activity android:name="com.lisa.lktc.func.SplashActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
调用:startActivity(Intent(XXX.class,context))
Intent.setAction().setCategory()
startActivity()//需要详细再对照一遍
Service:
启动Service的方式:StartService,BindService?
Service的具体需要实现的方法,以及方法的传递?
bindService(_pushServiceIntent, _pushServiceConnection, Context.BIND_AUTO_CREATE);
private ServiceConnection _pushServiceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
_pushService = IPushServicesAIDL.Stub.asInterface(service);
try {
_pushService.registerCallBack(_pushServiceCallBack);
} catch (RemoteException e) {
}
}
@Override
public void onServiceDisconnected(ComponentName name) {
}
};
public IBinder onBind(Intent intent) {
return mBinder;
}
private Binder mBinder = new IPushServicesAIDL.Stub() {
@Override
public void registerCallBack(IPushCallBack cb) throws RemoteException {
_callback = cb;
}
@Override
public void unregisterCallBack(IPushCallBack cb) throws RemoteException {
_callback=null;
}
};
BroadCast:
注册:?
定义:?
启动:?
发送和接收:?