随便记录记录

public void setOnClickListener(View.OnClickListener l)
Since: API Level 1

Register a callback to be invoked when this view is clicked. If this view is not clickable, it becomes clickable.

当这个view被点击/打开时,记录它的返回。如果这个view是不可点击的,那么将其变为可点击/打开。

Parameters
lThe callback that will run
执行参数指定的动作。

*************************************************************************************************************************

 void android.app.Activity.finish()

public void finish ()

Since: API Level 1

Call this when your activity is done and should be closed. The ActivityResult is propagated back to whoever launched you via onActivityResult().

***************************************************************************************************************************************************************************************

 

public ComponentName startService (Intent service)

Since: API Level 1

Request that a given application service be started. The Intent can either contain the complete class name of a specific service implementation to start, or an abstract definition through the action and other fields of the kind of service to start. If this service is not already running, it will be instantiated and started (creating a process for it if needed); if it is running then it remains running.

Every call to this method will result in a corresponding call to the target service's onStartCommand(Intent, int, int) method, with the intent given here. This provides a convenient way to submit jobs to a service without having to bind and call on to its interface.

Using startService() overrides the default service lifetime that is managed by bindService(Intent, ServiceConnection, int): it requires the service to remain running until stopService(Intent) is called, regardless of whether any clients are connected to it. Note that calls to startService() are not nesting: no matter how many times you call startService(), a single call to stopService(Intent) will stop it.

The system attempts to keep running services around as much as possible. The only time they should be stopped is if the current foreground application is using so many resources that the service needs to be killed. If any errors happen in the service's process, it will automatically be restarted.

This function will throw SecurityException if you do not have permission to start the given service.

Parameters
service Identifies the service to be started. The Intent may specify either an explicit component name to start, or a logical description (action, category, etc) to match an IntentFilter published by a service. Additional values may be included in the Intent extras to supply arguments along with this specific start call.
Returns
  • If the service is being started or is already running, the ComponentName of the actual service that was started is returned; else if the service does not exist null is returned.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值