小编grr*_*ore的帖子

如何在Android中安排通知

我正试图在将来设置通知.我有创建通知的代码,但我找不到安排它的选项.

我该如何安排通知?

java notifications android android-notifications

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

浮动操作按钮不显示在recyclerview上(在DrawerLayout内)

我试图让FAB超过recyclerview,在我的情况下将覆盖整个屏幕.FAB不会显示甚至recyclerview是空的.以下是我的xml代码.

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="com.technistan.ledger.CreateLedger"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <include
            android:id="@+id/tool_bar"
            layout="@layout/tool_bar"
            ></include>


        <FrameLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <android.support.v7.widget.RecyclerView
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:id="@+id/recyclerView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"

                />


            <android.support.design.widget.FloatingActionButton
                android:id="@+id/myFAB"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom|end"
                android:layout_margin="20dp"
                app:elevation="4dp" />


        </FrameLayout>

    </LinearLayout>


    <fragment
        android:id="@+id/fragment_navigation_drawer"
        android:layout_width="280dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:layout="@layout/fragment_navigation_drawer"
        android:name="com.technistan.ledger.NavigationDrawerFragment"
        tools:layout="@layout/fragment_navigation_drawer" />


    </android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)

预览显示浮动按钮,如下图所示; https://www.dropbox.com/s/18u5pt5v6kkkibj/Screen%20Shot%202015-09-13%20at%201.19.20%20PM.png?dl=0

但是当我运行应用程序时,没有显示FAB.我曾尝试过很多种组合,但都没能成功.我在listview上尝试了这个没有navigationdrawer(简单的活动,它在那里工作,即在listview上显示).

任何帮助将不胜感激.谢谢

[编辑:]我认为问题是由于父布局,即android.support.v4.widget.DrawerLayout,我复制粘贴代码从开始到结束到另一个空活动,它显示浮动按钮在那里.但仍然无法弄清楚如何解决这个问题,我需要在Drawerlayout中显示浮动操作按钮.

android floating-action-button android-recyclerview

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

无法从“App.js”解析“@react-navigation/native” - React Native + 如何解决?

undefined 无法@react-navigation/nativeApp.js以下位置解析模块:在项目中找不到 @react-navigation/native。

如果您确定该模块存在,请尝试以下步骤:

 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules: rm -rf node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
- node_modules\react-native\Libraries\Utilities\HMRClient.js:307:41 in showCompileError
- node_modules\react-native\Libraries\Utilities\HMRClient.js:228:26 in client.on$argument_1
- node_modules\eventemitter3\index.js:181:39 in emit
- node_modules\metro\src\lib\bundle-modules\WebSocketHMRClient.js:80:20 in _ws.onmessage
- node_modules\event-target-shim\dist\event-target-shim.js:818:39 in EventTarget.prototype.dispatchEvent
- node_modules\react-native\Libraries\WebSocket\WebSocket.js:232:27 in _eventEmitter.addListener$argument_1
- node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:190:12 in emit
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:436:47 in __callFunction
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:111:26 in __guard$argument_0
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:384:10 in __guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:110:17 …
Run Code Online (Sandbox Code Playgroud)

mobile-development react-native react-navigation stack-navigator react-navigation-stack

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

Node.js - FCM 发送预定主题通知

我正在使用 Angular 应用程序和 Node.js 服务器使用 FCM 向 Android 设备发送主题通知。我正在使用公牛来安排通知。

有两种发送通知的方式:立即发送通知和在特定日期和时间发送通知。

要发送通知,我正在使用 Angular 应用程序和此方法:

  sendTopicNotification(notification: Notification): Observable<any> {
    console.log("send topic");
    return this.http.post(endpoint + `notifications/send/topic/topic${notification.target}`, JSON.stringify(notification), httpOptions).pipe(
      map(result => { return true; })
    );
  }
Run Code Online (Sandbox Code Playgroud)

这是我的 Node.js 代码:

const express = require('express');
const router = express.Router();
const fb = require('../firebase/fb');
const db = fb.firestore();
const fcm = fb.messaging();
const moment = require('moment');

var Queue = require('bull');
var notificationsQueue = new Queue('topic notifications', { redis: { port: 6379, host: '127.0.0.1' } …
Run Code Online (Sandbox Code Playgroud)

javascript node.js firebase firebase-cloud-messaging angular

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

从字符串 SQL 的末尾删除新行

我有一个名为 Players 的数据库表,有近 400 行。我在DB Browser for SQLite下使用sqlite

我的所有文本字段都在字符串末尾添加了“\n”。

前任:

"Louie
"
Run Code Online (Sandbox Code Playgroud)

我尝试使用 RTRIM 来消除空格,但没有成功。

我怎样才能从

"Louie
"
Run Code Online (Sandbox Code Playgroud)

"Louie"
Run Code Online (Sandbox Code Playgroud)

sql sqlite

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