我TextField在 Qt Creator 中有一个 QML 。我想从文本字段 UI 中获取文本。我怎么做?
我正面临取消特定警报的问题.我使用报警管理器SET方法设置多个报警.但我无法取消特定的警报.如果我取消,它将取消之前设置的所有警报.我正在使用单个ALARM MANAGER ID来设置多个警报.
保存方法
private void saveState()
{
// String date = mDateText.getText().toString();
String title = mTitleText.getText().toString();
String body = mBodyText.getText().toString();
String sdate = sDateText.getText().toString();
String stime = sTimeText.getText().toString();
String rdate = rDateText.getText().toString();
String rtime = rTimeText.getText().toString();
String appRemDate = ((Button)findViewById(R.id.enterdaterem)).getText().toString();
String appRemTime = ((Button)findViewById(R.id.entertimerem)).getText().toString();
Calendar cal = Calendar.getInstance();
//setting date & month
if(appRemDate.substring(0,2).endsWith("-" ) && appRemDate.substring(2,4).endsWith("-" ))
{
cal.set(Calendar.YEAR, Integer.parseInt(appRemDate.substring(4,8)));
cal.set(Calendar.MONTH, Integer.parseInt(appRemDate.substring(2,3)) -1);
cal.set(Calendar.DATE, Integer.parseInt(appRemDate.substring(0,1)));
}
else if( !appRemDate.substring(0,2).contains("-" ) && !appRemDate.substring(3,5).contains("-" ) )
{
cal.set(Calendar.YEAR, Integer.parseInt(appRemDate.substring(6,10)));
cal.set(Calendar.MONTH, Integer.parseInt(appRemDate.substring(3,5)) …Run Code Online (Sandbox Code Playgroud) 这是我的代码,用于将值从活动类传递给我的服务类.
Intent i = new Intent(this, MyAlarmService.class);
i.putExtra("rowId", rowId);
startactivity(i);
Run Code Online (Sandbox Code Playgroud)
我怎样才能在我的服务类中获得rowId?请帮我