【问题标题】:How to apply EmojiCompat at Android RemoteView(Notification)如何在 Android RemoteView 上应用 EmojiCompat(通知)
【发布时间】:2018-07-18 03:29:59
【问题描述】:

我尝试在 Notification 的 RemoteView 上应用 EmojiCompatibility。

在 RemoteView(Notification) 上使用 EmojiTextView 时应用崩溃。

        <android.support.text.emoji.widget.EmojiTextView
            android:id="@+id/tv_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

我也尝试了另一个(java代码)

    EmojiCompat.get().registerInitCallback(new EmojiCompat.InitCallback() {
        @Override
        public void onInitialized() {
            final EmojiCompat compat = EmojiCompat.get();
            remoteViews.setTextViewText(R.id.tv_name,
            compat.process("item.getEmoticon()");
        }
    });

如何在 RemoteView 中使用它?

错误代码(在布局中应用 EmojiTextView 时。)

无法放大通知视图

android.view.InflateException:二进制 XML 文件第 39 行:错误 膨胀类 android.support.text.emoji.widget.EmojiTextView

无法扩展 RemoteViews:StatusBarNotification

【问题讨论】:

  • 添加依赖编译“com.android.support:support-emoji:26.0.1”

标签: android notifications remoteview


【解决方案1】:

您不能将 emojicompat 用于远程视图。

【讨论】:

    猜你喜欢
    • 2014-07-21
    • 2014-10-17
    • 2012-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多