
本文共 4367 字,大约阅读时间需要 14 分钟。
- ������������������������������Activity���������������������������Task���������������
- Activity���������service������������������activity������������������������service���
- ������
bindService()
��� - ������
startService()
��� -
- ���������Service������������������������������������Service������������������������������������������������������Service���
- onCreate()
- onStartCommand()
- onDestroy()
- onBind()
- onUnbind()
- onServiceConnected()
- onServiceDisconnected()
- ������
startService()
������������������onStartCommand()
���������������stopService()
��������������������������������������������������� - ������
bindService()
������������������onBind()
��������������������������������������������������������������������������������������������������� - ������service���B���������������������������A���������B���������������������������������������������
- ���������IntentService������������������
������������������
������������������������
onHandleIntent()
������������������������������������������������UI������
������������������������
������������������Service���
- ���������������������������������������������������������������
- ��� BroadcastReceiver������������
- ������������������UI������������������������
- ������������������������������������������������
- ���������������������������
- ���������������Intent���Intent Filter���
- Action
- Data���������URI���MIME������������������������������������
- Category
- Intent���������������������������������������������������
- ���������������
- ������URI���
MIME������������������������������������������������������������~/.class������������������������������������������������������������
Activity���Intent���Service������������������
- Activity������������������������������������������
- Intent���������������������������������������������������
- Service������������������������������������������������������������
Service���Android������������������������������������������������������������������������������
Service������������������������
Service���
onCreate()
������������������������������������startService()
������bindService()
, ���������Service���������������������������������������������
stopService()
���������onDestroy()
���unbindService()
������������onUnbind()
���onDestroy()
������������������stopService()
���onDestroy()
���������������������������������������������������
startActivityForResult(new Intent(A.this, B.class));
B���������������������������������������
onActivityResult
���������������������������������������������IntentService���Android������������������������������������������������Service���������������������������
������������Service������������������
Service���������������������������������������������������������������������������������
Intent���Android������������������������������������������������������������������Intent Filter���������������������������������������������������������������
������������Intent������������������������������������Intent Filter���������������������������������
Intent������������������������������������
intent.putExtra("data", "���������");// ������������������Parcelable������Parcelable data = new Parcelable() {};intent.putExtra("data", data);
intent.setData("content://com.example appraisal");
������������Android���������������������������������������������������������������
���������������������������������������
startActivity(new Intent(this, MusicPlayerActivity.class));
������Intent������Activity������������������������������������������������Service������������������������������������
������������������������������������������Service������������������������������Scene������Activity���������������
������������������Activity������������������Task���������������������������������������Activity������������������Intentflag���������������������������
���������
Intent intent = new Intent(A.this, B.class);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);
���������������Activity������������Task���������������
������������������������������������
Intent intentService = new Intent(this, MyService.class);bindService(intentService, new MyServiceConnection(), BIND_AUTO_CREATE);
������ServiceConnection
������������������������������������������bindService()
���unbindService()
������������������������������������������
startService(new Intent(this, MyService.class));
startService()
������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
