当我长按空的EditText时(不带非空的确定),不会出现粘贴建议弹出窗口。
XML格式
<EditText
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="right"
android:textSize="50sp"
android:inputType="numberDecimal"
android:id="@+id/text"/>
Run Code Online (Sandbox Code Playgroud)
接触EditText的代码
editText.setRawInputType(InputType.TYPE_NULL);
if (Build.VERSION.SDK_INT >= 11) {
editText.setTextIsSelectable(true);
} else {
editText.setFocusable(true);
}
Run Code Online (Sandbox Code Playgroud) load().print().创建指向字符串的全局指针,创建字符串数组load()并将本地数组指定给全局指针.
如果我尝试在内部打印全局数组(以及本地数据)load(),一切都很好,但是在打印的情况下print(),segfault会出现在数组末尾的某处.GDB和valgrind输出对我来说似乎很神秘.我放弃.怎么了?
来源和字典在这里.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
// length of the longest word in dictionary
#define LENGTH 45
// dictionary file
#define DICTIONARY "large"
// prototypes
void load(const char* dictionary);
void print(void);
// global dictionary size
int dict_size = 0;
// global dictionary
char **global_dict;
int main(void)
{
load(DICTIONARY);
print();
return 0;
}
/**
* Loads dictionary into …Run Code Online (Sandbox Code Playgroud) 我以这种方式发出抬头通知:
Notification.Builder nb = new Notification.Builder(context)
.setSmallIcon(icon)
.setContentTitle("Title")
.setContentText("Content")
.setDeleteIntent(delete)
.setPriority(Notification.PRIORITY_HIGH)
.setVibrate(new long[0]);
notificationManager.notify(1, nb.build()); // TODO hardcode
Run Code Online (Sandbox Code Playgroud)
第一次在测试设备上安装应用程序时,通知会抬头,但是如果我扩展通知区域(抬头仍在运行时)并从那里取消通知,则下次通知不会抬头。重新安装应用程序后,通知会再次提示。请问有什么原因不能使抬头行为保持不变?