我想找到两个日期之间的总天数.
例如今天是01-01-2011(DD-MM-YYYY),第二个日期是(25-03-2011),我如何找到总天数?
NSDate *currentdate=[NSDate date];
NSLog(@"curretdate is ==%@",currentdate);
NSDateFormatter *tempFormatter1 = [[[NSDateFormatter alloc]init]autorelease];
[tempFormatter1 setDateFormat:@"dd-mm-YYYY hh:mm:ss"];
NSDate *toDate = [tempFormatter1 dateFromString:@"20-04-2011 09:00:00"];
NSLog(@"toDate ==%@",toDate);
Run Code Online (Sandbox Code Playgroud) 我希望通过"使用完整操作..."对话框将我的应用程序注册为电话呼叫处理程序.我发现如果我在清单中使用以下语法,它会起作用:
<activity android:name="my.class">
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
但如果我将其注册为广播接收器,我的应用程序不会显示在"使用...完成操作"对话框中.
<receiver android:name="my.class">
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
</receiver>
Run Code Online (Sandbox Code Playgroud)
一旦Intent与过滤器匹配,除了要调用的类的类型之外,两者之间有什么区别?