我希望我的推送通知有两个按钮,但我找不到任何地方如何这样做.任何人都可以解释如何在Android中的推送通知中添加按钮吗?
NotificationCompat.Builder notification;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_verify);
notification=new NotificationCompat.Builder(this);
notification.setAutoCancel(true);
/* blah blah blah */
}
public void onVerify(View v)
{
/*
some code
*/
if(example){ /* another piece of code */ }
else{
String num=data.getString("Phone");
this.defineNotification(num);
//Log.i(TAG,"here ");
Intent i=new Intent(this,VendorDetails.class);
i.putExtra("Phone",num);
startActivity(i);
}
}
public void defineNotification(String num)
{
notification.setContentTitle("Successful");
notification.setContentText("Hi, I am being displayed now");
notification.setWhen(System.currentTimeMillis());
notification.setSmallIcon(R.mipmap.ic_launcher);
Intent i=new Intent(this,OrderTypes.class);
PendingIntent pi=PendingIntent.getActivity(this, 0, i, 0);
notification.addAction(R.mipmap.ic_launcher,"Accept",pi);
notification.addAction(R.mipmap.ic_launcher, "Decline", pi);
NotificationCompat.MediaStyle mediaStyle=new NotificationCompat.MediaStyle();
MediaSessionCompat mediaSession=new …Run Code Online (Sandbox Code Playgroud) 我试图更好地理解 Typescript 中的类型安全性,并遇到了这个场景,我有这个函数:
function test(x: number){
console.log(typeof x);
}
Run Code Online (Sandbox Code Playgroud)
如果我这样调用这个方法 - test('1')它会抛出编译时错误,但如果我将其更改为这样,它就可以正常工作:
let y: any = '1';
test(y);
//works fine
//Outputs "string"
Run Code Online (Sandbox Code Playgroud)
据我了解,将“x”声明为数字仅在编译时有效,并且 Typescript 仅强制编译时类型安全而不是运行时。所以,我想知道我是否理解正确或遗漏了任何内容,以及确保运行时类型安全的不同方法是什么?
我只需要修改一个函数.我试过这个:
IF EXISTS(SELECT * FROM Information_schema.Routines
WHERE Specific_schema = 'dbo'
AND SPECIFIC_NAME = 'fnTestFunc'
AND Routine_Type = 'FUNCTION')
BEGIN
ALTER FUNCTION [dbo].[fnTestFunc] (@input VARCHAR(3))
RETURNS VARCHAR(2)
AS
BEGIN
--something
END
END
Run Code Online (Sandbox Code Playgroud)
但显示错误
ALTER FUNCTION必须是批处理中的单个查询
知道这里有什么问题吗?
我知道已有这样的问题,但我找不到任何可以帮助我的答案.
我正在尝试使用此命令获取我必须拥有MD5密钥的Google Maps API密钥:
keytool -list -v -alias androiddebugkey -keystore "/Users/Sachin Parashar/.android/debug.keystore" -storepass android -keypass android
Run Code Online (Sandbox Code Playgroud)
但它给出了这个错误:
keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
java.io.IOException: Keystore was tampered with, or password was incorrect
at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:780)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:56)
at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:225)
at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:70)
at java.security.KeyStore.load(KeyStore.java:1445)
at sun.security.tools.keytool.Main.doCommands(Main.java:792)
at sun.security.tools.keytool.Main.run(Main.java:340)
at sun.security.tools.keytool.Main.main(Main.java:333)
Caused by: java.security.UnrecoverableKeyException: Password verification failed
at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:778)
... 7 more
Run Code Online (Sandbox Code Playgroud)
有谁知道这个命令有什么问题?