sac*_*chi 0 service android android-intent
这是我的代码,用于将值从活动类传递给我的服务类.
Intent i = new Intent(this, MyAlarmService.class);
i.putExtra("rowId", rowId);
startactivity(i);
Run Code Online (Sandbox Code Playgroud)
我怎样才能在我的服务类中获得rowId?请帮我
试试这个,
public int onStartCommand (Intent intent, int flags, int startId)
{
super.onStartCommand(intent, flags, startId);
String id = intent.getStringExtra("rowId");
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2589 次 |
| 最近记录: |