小编Nom*_*fan的帖子

如何创建仍然允许触摸其边界外的本机控件的浮动可触摸活动?

我试图实现的目标最好用我用mspaint制作的方案来解释:

在此输入图像描述

我试图设置FLAG_NOT_TOUCH_MODAL哪个描述应该是我想要的,但它根本不起作用.我的活动消耗所有触摸事件,甚至在其边界之外.

如果我设置FLAG_NOT_FOCUSABLE当然活动下的本机控件是可触摸的,但是当触摸其边界内时活动完全不均匀.

我试过设置isFloatingWindow=true清单,但似乎没有任何区别.

谁能实现这个目标?我非常感谢以这种方式工作的小型演示活动,因此我可以从那里开始工作.我已经尝试了很多WindowManager和Intent标志的排列,似乎没有任何东西可以完全按照我的需要工作.

提前致谢.

更新:

我已经尝试了你的建议,但它仍然无法正常工作.

这是我的活动布局xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="385dp"
android:layout_height="300dp"
android:theme="@android:style/Theme.Dialog"
tools:context="com.ui.activities.TestActivity"
android:id="@+id/testLayout"
android:visibility="visible"
android:background="@drawable/abc_ab_solid_light_holo"
android:clickable="true">

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Click me"
    android:id="@+id/button"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="35dp"
    android:clickable="true"
    android:enabled="true"
    android:onClick="onClick" />
Run Code Online (Sandbox Code Playgroud)

这是Activity班级:

public class TestActivity extends Activity implements View.OnClickListener {

private String TAG = TestActivity.class.getSimpleName();

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test);

    setWindowParams();
}

private void setWindowParams() {
    WindowManager.LayoutParams wlp = getWindow().getAttributes();
    wlp.dimAmount = 0;
    wlp.flags = …
Run Code Online (Sandbox Code Playgroud)

android floating android-activity

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

Android注释 - 注入超类类型列表

我正在尝试使用Android Annotations实现以下Spring代码:

@Autowired
public initHandlerList(List<Handler> handlerList) {
   // Do stuff with the list ...
}
Run Code Online (Sandbox Code Playgroud)

我尝试使用接口和类.

Bean定义:

@EBean
public AbstractHandler implements Handler {}
Run Code Online (Sandbox Code Playgroud)

试图注入:

@Bean
public initHandlersList(List<AbstractHandler> handlersList) {
  // Do stuff with the list ...
}
Run Code Online (Sandbox Code Playgroud)

但总是得到以下错误:

Error:(20, 5) error: org.androidannotations.annotations.Bean can only be used on an element annotated with @org.androidannotations.annotations.EBean
Run Code Online (Sandbox Code Playgroud)

所以我想因为列表本身没有注释,@EBean它不能用作Bean ...任何使用Android Annotations实现这一点的方法?

谢谢 !

java spring android annotations

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

在基于FlymeOS的设备上,GCM推送通知不会进入睡眠模式

在我们的应用程序中,我们使用基于GCM的批量推送通知服务.

最近几周,我们遇到了一个问题,即在某些设备中,当设备处于睡眠模式时,我们发送的推送通知不会到达.在许多情况下,我们必须唤醒设备并发送额外的推动,然后才会到达.

经过大量调查后,我们发现了这个可疑日志:W/GCM-DMM:强制释放GOOGLE_C2DM锁

只要推送通知无法到达,就会显示此日志.

这似乎发生在基于FlymeOS的设备(Meizu,Xiaomi ..)中.其他设备受到的推动很大.我们总是以高优先级发送它们.

我们非常感谢您可以提供给我们的任何建议,或者有关为什么要发布此c2dm锁以及如何防止它的任何信息.

莫尔,提前谢谢

android push-notification

5
推荐指数
0
解决办法
262
查看次数

在 Java 代码中运行 JMeter - JMeterThread 不运行采样器

所以我在我的 Maven 项目中使用了这个例子:

public class JMeterFromScratch {

public static void main(String[] argv) throws Exception {

    //JMeter Engine
    StandardJMeterEngine jmeter = new StandardJMeterEngine();

    //JMeter initialization (properties, log levels, locale, etc)
    JMeterUtils.loadJMeterProperties("C:/git/jbehave-snbtracker/src/main/resources/config/jmeter.properties");
    //JMeterUtils.initLogging();// you can comment this line out to see extra log messages of i.e. DEBUG level
    JMeterUtils.initLocale();

    // JMeter Test Plan
    HashTree testPlanTree = new HashTree();

    // HTTP Sampler
    HTTPSampler httpSampler = new HTTPSampler();
    httpSampler.setDomain("example.com");
    httpSampler.setPort(80);
    httpSampler.setPath("/");
    httpSampler.setMethod("GET");

    // Loop Controller
    TestElement loopController = new LoopController();
    ((LoopController)loopController).setLoops(1);
    loopController.addTestElement(httpSampler);
    ((LoopController)loopController).setFirst(true);
    ((LoopController)loopController).initialize(); …
Run Code Online (Sandbox Code Playgroud)

java jmeter

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

Spring boot 使用希伯来语发送请求时,特定机器上的 UTF-8 中间字节无效

我正在使用 Spring boot mvc,并且遇到一个问题,该问题仅在我的临时计算机上重现,但在本地运行良好。

\n\n

我发送以下 JSON 请求(注意“whatever”字段下的希伯来字符):

\n\n
{\n "messageInitiaterId":"0542258808",\n "destinationId":"0544556543",\n "whatever":"\xd7\x9e\xd7\xa9\xd7\x94\xd7\x95",\n "pushToken":"e2eeb632-8c2c-4ad2-a163-cfeb671d1955",\n "androidVersion":"7.1.1",\n "deviceModel":"huawei nexus 6p",\n "appVersion":"1.42"\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

在本地,它返回响应,一切都很好。在登台计算机上,这是返回的响应:

\n\n
{\n  "timestamp": 1485591099485,\n  "status": 400,\n  "error": "Bad Request",\n  "exception":          \n\n    "org.springframework.http.converter.HttpMessageNotReadableException",\n  "message": "Could not read document: Invalid UTF-8 middle byte 0x3f\\n at [Source: java.io.PushbackInputStream@6996e7d; line: 4, column: 17]; nested exception is com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 middle byte 0x3f\\n at [Source: java.io.PushbackInputStream@6996e7d; line: 4, column: 17]",\n  "path": "/v1/IsRegistered"\n\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

目前使用 Postman 来重现这一点。请求的标头是:

\n\n
"Content-Type":"application/json; charset=UTF-8"\n
Run Code Online (Sandbox Code Playgroud)\n\n

我还尝试将希伯来语添加到运行 Windows 8 的机器本身,但似乎没有什么区别。 …

java spring json character-encoding spring-boot

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