小编Saa*_*iko的帖子

究竟如何使用Notification.Builder

我发现我使用了一种不赞成使用的方法(notification.setLatestEventInfo())

它说使用Notification.Builder.

  • 我该如何使用它?

当我尝试创建一个新实例时,它告诉我:

Notification.Builder cannot be resolved to a type
Run Code Online (Sandbox Code Playgroud)

api notifications android deprecated

99
推荐指数
3
解决办法
16万
查看次数

我的代码有什么问题 - 通知 - 没有声音没有振动

我的代码似乎有问题.我创建了一个测试活动,只是为了看错了,但我还是不能.

public class test extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    String extra = "test";

    NotificationManager myNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

    Intent intent = new Intent(this, test.class);

    Notification notification = new Notification(R.drawable.icon, 
            extra, 
            System.currentTimeMillis());
    PendingIntent pendingIntent = PendingIntent.getActivity(this, 
            0,
            intent,
            PendingIntent.FLAG_UPDATE_CURRENT);

    notification.setLatestEventInfo(getApplicationContext(), "title", "text", pendingIntent);
    notification.flags |= Notification.DEFAULT_SOUND;
    notification.flags |= Notification.DEFAULT_LIGHTS;
    notification.flags |= Notification.DEFAULT_VIBRATE;
    notification.flags |= Notification.FLAG_INSISTENT;
    notification.flags |= Notification.FLAG_AUTO_CANCEL;

    myNotificationManager.notify(33, notification);

}
}
Run Code Online (Sandbox Code Playgroud)

当通知弹出时,我没有声音和/或振动.

我查看了手机的设置,它们没问题,没有静音,默认声音启用.

audio notifications android default

10
推荐指数
2
解决办法
1万
查看次数

是否有在线服务来计算开放和结束括号?

是否有人熟悉在线服务,我可以粘贴一些代码,它告诉我

  1. 如果我的所有支架都到位 - 没有丢失/添加一个关闭括号?
  2. 根据语言语法 - 代码是对的吗?

    • 我同意大多数编辑的配色方案/或者给你一个错误.这个特定的不是:-)它被称为:记事本^^ - 我使用了很多,但仍然.如果存在这样的服务 - 无论您使用什么IDE,它都可以提供帮助.如果您想要检查一段代码 - 并且不想打开IDE

示例('3'部分有一个缺少的括号):

IF( OR( ISBLANK(BillingCountry), UPPER(BillingCountry) = 'UNITED STATES' , UPPER(BillingCountry) = 'USA', UPPER(BillingCountry) = 'US', UPPER(BillingCountry) = 'U.S.', UPPER(BillingCountry) = 'U.S.A.' ), 

IF ( OR( BillingState = 'CA' , BillingState = 'WA' , BillingState = 'OR' , BillingState = 'ID' , BillingState = 'NV' , BillingState = 'MT' , BillingState = 'WY' , BillingState = 'CO' , BillingState = 'UT' , BillingState = 'AZ' , BillingState …
Run Code Online (Sandbox Code Playgroud)

syntax-error

6
推荐指数
2
解决办法
2万
查看次数

如何在POST方法中填充表单

我在网站上有一个表单,我需要手动提交数百条记录.表单是POST方法.

我试着用简单的:http://.../form?incomingLead__email=MYNAME.但这没用.

如何操作表单提交操作以包含值?

在此输入图像描述

尝试使用单个字段,如下所示:这是HTML中的First Name属性:

<input id="incomingLead__firstName" name="incomingLead__firstName" 
class="text" style="" type="text" onkeypress="var _this=this;return 
onEnterPressed(event, function()
{document.controller.setValue('/ctx/incomingLead/@firstName',
_this.value, 'incomingLead__firstName');return true;});" 
onblur="document.controller.setValue('/ctx/incomingLead/@firstName', 
this.value, 'incomingLead__firstName')">
Run Code Online (Sandbox Code Playgroud)

表单属性是:

<form method="post" name="page" class="main-navigation" id="page-form">
Run Code Online (Sandbox Code Playgroud)

提交按钮:

<button type="button" id="link-link330" onclick="return linklink330();">Submit</button>
Run Code Online (Sandbox Code Playgroud)

验证JS功能:

function toValidate() {
  var temp = document.getElementById('temp')
  if (!temp) return document.controller.submit('submit');

  document.controller.setValue("/ctx/vars/iCountProducts", temp.options.length);


  for (var i = 0; i < temp.options.length; i++)
    document.controller.setValue("/ctx/vars/products/product" + i, temp.options[i].value);

  return document.controller.submit('submit');
}
Run Code Online (Sandbox Code Playgroud)

我想有一个excel文件,并连接我需要的链接,至少我可以减少填写数据的时间,2点击:一个在Excel中打开webform,然后提交.

是否有可能提供数据?

forms

6
推荐指数
1
解决办法
289
查看次数

有什么区别:notification.flags和notification.defaults?

在我的测试代码中,我使用过

        notification.flags |= Notification.DEFAULT_SOUND;
    notification.flags |= Notification.DEFAULT_LIGHTS;
Run Code Online (Sandbox Code Playgroud)

这没有用,根据我得到的另一个问题的答案,我改变了.flags到.defaults并且它有效.

        notification.defaults |= Notification.DEFAULT_SOUND;
    notification.defaults |= Notification.DEFAULT_LIGHTS;
Run Code Online (Sandbox Code Playgroud)

文档中,两个字段:标志和默认值是相同的.

我什么时候使用哪个?我可以设置同一家族的2个标志吗?

notifications flags android default

4
推荐指数
1
解决办法
3435
查看次数

Salesforce如何取消排队的Apex Future Jobs

我正在为之工作的组织在一个名为Cases.cls的类中调用一些代码的情况下触发了一个触发器.我修改了代码,但在尝试部署时,我不断收到错误:挂起或未来的调用.

自2010年以来,我发现了17个排队的未来工作!有一个文本在其旁边有"中止",我能够这样做,但我没有看到任何方法取消其余的.

我尝试通过开发人员控制台检索其中一个作业,并且成功了,但它不允许任何dml语句.

有谁知道如何删除排队的作业,以便我可以部署我的更改?

jobs future salesforce apex-code

3
推荐指数
1
解决办法
1万
查看次数

服务没有开始

我正在写第一份服务.我的活动效果很好,但是当我打电话给我的服务时,却没有.

看起来它onCreate()没有被调用.

我的服务代码:

public class NeglectedService extends Service {
    public static final String MY_SERVICE = "android.intent.action.MAIN";
    public void onCreate() {
        Toast.makeText(this, "Service onCreate...", Toast.LENGTH_LONG).show();
    }
}
Run Code Online (Sandbox Code Playgroud)

我甚至没有收到Toast的消息.

这是我的活动

startService(new Intent(NeglectedService.MY_SERVICE));
Run Code Online (Sandbox Code Playgroud)

我的清单

action android:name="android.intent.action.MAIN"
Run Code Online (Sandbox Code Playgroud)

service android

2
推荐指数
1
解决办法
2112
查看次数

是否可以在 Salesforce 中的同一对象上创建多对多关系

我们的客户之间的相互关系为:供应商-买家,意思是:我们向我们所在行业的供应商和买家销售产品。

我试图将我们的客户(他们之间)的关系存储在销售人员中。这是一种多对多关系。因此,在每个帐户上,我都希望有一个相关的列表,其中包含其销售的所有买家以及从中购买的卖家(在其他帐户上反之亦然)

我尝试使用连接对象,但无法在同一对象(主要是帐户)上创建 2 个主从关系。

是否可以?

data-modeling salesforce

0
推荐指数
1
解决办法
2451
查看次数