草庐IT

null_unspecified

全部标签

android.util.Patterns.EMAIL 在单元测试期间返回 null

我有一个验证器中包含android.util.Patterns.EMAIL_ADDRESS的代码。它在针对设备运行时运行良好,但当我在单元测试中运行此代码时,它返回null。此外,我尝试复制并粘贴模式中的内部代码,如下例所示。validateEmail1有效//whyyy???validateEmail2返回nullprivatestaticfinalPatternEMAIL=Pattern.compile("[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}"+"\\@"+"[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}"+"("+"\\."+"

android - AutocompleteFragment 结果返回一个具有 null 属性的地方

我正在尝试制作一个带有抽屉导航和mapfragment的应用程序。我试图拥有一个自动完成fragment,但是当我搜索一个地方时,我只收到name和id属性。像这样:I/PLACE:Place{address=null,attributions=[],id=ChIJVXealLU_xkcRja_At0z9AGY,latLng=null,name=Amsterdam,openingHours=null,phoneNumber=null,photoMetadatas=null,plusCode=null,priceLevel=null,rating=null,types=null,user

SQL 中的 NULL 值:定义、测试和处理空数据,以及 SQL UPDATE 语句的使用

SQLNULL值什么是NULL值?NULL值是指字段没有值的情况。如果表中的字段是可选的,那么可以插入新记录或更新记录而不向该字段添加值。此时,该字段将保存为NULL值。需要注意的是,NULL值与零值或包含空格的字段不同。具有NULL值的字段是在记录创建期间留空的字段。如何测试NULL值?使用比较运算符(如=、)无法测试NULL值。相反,我们必须使用ISNULL和ISNOTNULL运算符。ISNULL语法SELECT列名FROM表名WHERE列名ISNULL;ISNOTNULL语法SELECT列名FROM表名WHERE列名ISNOTNULL;演示数据库以下是示例中使用的Customers表的一

android - searchManager.getSearchableInfo(getComponentName()) 返回 null

我关注了thisAndroidguide为了向Activity添加搜索栏。设置如下所示:res/menu/activity_main.xml:res/xml/searchable.xml:list文件中的Activity条目:以及MainActivity中的代码:@SuppressLint("NewApi")@OverridepublicbooleanonCreateOptionsMenu(Menumenu){this.getMenuInflater().inflate(R.menu.activity_main,menu);if(Build.VERSION.SDK_INT>=Build

android TextInputLayout 在将错误设置为 null 后更改 EditText 样式

我第一次使用新的Android小部件TextInputLayout,它非常好,但我在使用setError方法时遇到了一些问题这是我的xml发生了什么:当我运行时setError("errormessage")整个EditText背景和提示文本颜色变为红色,因为这里很好。问题是当我运行setError(null)EditText的样式与原来的完全不同。起始情况:不专心专注的之后setError("必填字段")之后setError(null)我做了很多研究,但找不到任何有用的东西,这到底是什么问题??更新调查setError()方法的android源代码我发现了这个publicvoidse

android - Android 中的 CreateFromStream 为某些 url 返回 null

publicclassTestButtonextendsActivity{/**Calledwhentheactivityisfirstcreated.*/ImageButtonimgBtn;@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.main);imgBtn=(ImageButton)findViewById(R.id.image);//Stringurl="http://thenextweb.com/a

android - getSupportFragmentManager().findFragmentById 为 android fragment 中的谷歌地图返回 null?

我在使用Googlemap时遇到问题,即getSupportFragmentManager().findFragmentById始终返回null。您知道如何解决这个问题吗?代码如下:fragment_map.xml:MapsFragment.java:publicclassMapFragmentextendsFragmentimplementsOnMapReadyCallback,android.location.LocationListenerpublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstan

android - 使用 gson 和 null 值反序列化

我正在尝试使用空值反序列化我自己的类。但是我的代码不起作用。我的JSON:{"Text":null,"Code":0,"Title":"ThisisSparta!"}在我的方法中,我执行以下操作:this.setText(gson.fromJson(jsonObject.getString("Text"),String.class));this.setTitle(gson.fromJson(jsonObject.getString("Title"),String.class));this.setCode(gson.fromJson(jsonObject.getString("Facco

我想默认设置关键字值null,并且还要设置错误消息,如果通过关键字找到记录如何可能

HTML组件:Search组件:我想设置null作为默认值keywordgetEmployees(page:number,keyword:string):void{this.employeeService.getEmployees(page,this.model.keyword).subscribe(employees=>{this.employees=employees;console.log(this.employees);this.setPage(page);console.log(this.model.keyword)});}看答案getEmployees(page:number,ke

android - 无法从加载程序 findLibrary 加载 lept 返回 null?

您好,我正在研究OCR(光学字符识别),我从github获得了一个示例项目。对于这个项目,我正在使用tess-test库项目,该项目构建并成功执行,但只要TessBaseAPI是调用应用程序不幸停止..它显示以下日志错误12-2018:27:18.791:E/AndroidRuntime(24466):java.lang.ExceptionInInitializerError12-2018:27:18.791:E/AndroidRuntime(24466):atcom.datumdroid.android.ocr.simple.SimpleAndroidOCRActivity.onPh