小编ste*_*uer的帖子

在膨胀MenuButton时"类型菜单的预期资源"

所以我的布局目录中有一个名为"actionbar_buttons.xml"的XML文件:

<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_height="match_parent"
      android:layout_width="match_parent">
     <item android:id="@+id/action_settings"
           android:title="Settings">
     </item>
     <item android:id="@+id/action_settings2"
           android:title="fooo">
     </item>
 </menu>
Run Code Online (Sandbox Code Playgroud)

在我的Fragment类中,我调用inflate方法,如下所示:

@Override
public void onCreateOptionsMenu(
        Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu( menu, inflater );
    inflater.inflate(R.layout.actionbar_buttons, menu);
}
Run Code Online (Sandbox Code Playgroud)

现在Intellij抱怨并告诉我:

Expected resource of type menu less... (Ctrl+F1) 
Reports two types of problems:
Supplying the wrong type of resource identifier. For example, when calling      Resources.getString(int id), you should be passing R.string.something, not R.drawable.something.
Passing the wrong constant to a method which expects one of a specific …
Run Code Online (Sandbox Code Playgroud)

android intellij-idea android-fragments

5
推荐指数
1
解决办法
3613
查看次数

otto eventbus for android在发布版本中表现不同

我有一个单件服务类,它按照设定的时间表从服务器中提取数据.一旦客户端收到数据,我就触发bus.post(new NewServerResponseEvent());(http://square.github.io/otto/)

然后在我的片段中我这样做:

@Override
public void onResume() {
    super.onResume();
    eventBus.register(this);
}

@Override
public void onPause() {
    super.onPause();
    eventBus.unregister(this);
}

@Subscribe
public void handleNewServerData(NewServerResponseEvent e) {
    refreshView();
}
Run Code Online (Sandbox Code Playgroud)

只要我在我的测试设备上进行开发时,一切都运行得非常顺利.一旦我构建了一个发布版本并将其放入Play商店,handleNewServerData()就永远不会调用该函数.

我无法理解这一点.将整个事物作为发布版本运行会有什么不同?是否有可能在另一个线程中发生的事情无法发布给我的订阅者?

有人能指出我正确的方向吗?

提前致谢

events multithreading android event-bus otto

5
推荐指数
1
解决办法
618
查看次数

运行kubelet时"x509:由未知权限签名的证书"

我正在尝试在CoreOS beta(1192.2.0)上使用kubelet 1.4.5安装kubernetes.

我正在使用稍微修改过的控制器版本和工作者安装脚本来自https://github.com/coreos/coreos-kubernetes/tree/master/multi-node/generic

所以一般我使用以下bash脚本在Gentoo Linux上创建许可证:

#!/bin/bash
export MASTER_HOST=coreos-2.tux-in.com
export K8S_SERVICE_IP=10.3.0.1
export WORKER_IP=10.79.218.3
export WORKER_FQDN=coreos-3.tux-in.com
openssl genrsa -out ca-key.pem 2048
openssl req -x509 -new -nodes -key ca-key.pem -days 10000 -out ca.pem -subj "/CN=kube-ca"
openssl genrsa -out apiserver-key.pem 2048
openssl req -new -key apiserver-key.pem -out apiserver.csr -subj "/CN=kube-apiserver" -config openssl.cnf
openssl x509 -req -in apiserver.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out apiserver.pem -days 365 -extensions v3_req -extfile openssl.cnf
openssl genrsa -out ${WORKER_FQDN}-worker-key.pem 2048
openssl req -new -key ${WORKER_FQDN}-worker-key.pem -out ${WORKER_FQDN}-worker.csr …
Run Code Online (Sandbox Code Playgroud)

coreos kubernetes kubelet

5
推荐指数
1
解决办法
8272
查看次数