草庐IT

set_null

全部标签

android - 在 fragment 中调用 getTag() 时总是返回 null

我有一个问题,因为当我在fragment中调用它时,getTag()方法返回null,fragment是我创建的ViewPager选项卡布局的一部分。代码importjava.util.ArrayList;importandroid.os.Bundle;importandroid.support.v4.app.Fragment;importandroid.support.v4.app.FragmentTransaction;importandroid.view.LayoutInflater;importandroid.view.View;importandroid.view.ViewG

android - 如何启动 "set as"intent(壁纸、联系人图片等)

我在过去的几周里(认真地)在网上搜索过,但我找不到我需要的东西。我只想启动一个与setas操作相对应的Intent。它通常提供设置为墙纸或设置为联系人图片。然后,如果设备上安装了更多应用程序,它们也可以列出。这是我想要的示例:我明确表示我需要支持API级别14及更高级别。我找到了getCropAndSetWallpaperIntent但它仅适用于contentURI这对我来说是个问题,并且仅适用于APIlvl19及更高版本。 最佳答案 我自己找到了答案:Intentintent=newIntent(Intent.ACTION_ATT

android - Plus.PeopleApi.getCurrentPerson 返回 null

我目前正在开发我的应用中的GooglePlus登录功能。我像下面这样创建了GoogleApiClient构建器Plus.PlusOptionsoptions=newPlus.PlusOptions.Builder().addActivityTypes("http://schemas.google.com/AddActivity").build();myGoogleApiClient=newGoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this)//.add

android - ListView getChildAt() 返回 null

我一直在做一个android项目,但遇到了一个问题。我用谷歌搜索但没有找到答案。在我的项目中,有一个名为viewsurahfragment的fragment,它包含一个id为lv_showquran的ListView。我想在指定索引处突出显示ListView的View。我正在使用listview.getchildat()但它返回null值。这是viewsurahfragment的代码。发出不相关的函数。publicclassViewSurahFragmentextendsFragment{privateListViewlistView;privateintcurrentSurah;pr

java.lang.IllegalArgumentException: Cannot pass null or empty values to constructor at org.springf

 java.lang.IllegalArgumentException:Cannotpassnulloremptyvaluestoconstructor   atorg.springframework.security.core.userdetails.User.(User.java:113)   atorg.springframework.security.core.userdetails.User$UserBuilder.build(User.java:535)   atcom.example.mz.spingsecurity_jwt_deepstudy.SpingsecurityJwtD

open-set recognition(OSR)开集识别

开集识别闭集识别​训练集中的类别和测试集中的类别是一致的,最常见的就是使用公开数据集进行训练,所有数据集中的图像的类别都是已知的,没有未知种类的图像。传统的机器学习的算法在这些任务上已经取得了比较好的效果。(训练集和测试集的类别是一致的)开集识别描述开集识别是一个在现实世界中最常见的问题,但是这个问题只有你在真正实施项目的时候才会遇到,使用公开数据集是不会遇到这个问题的。所谓的开集识别白话说就是在一个开放的数据集中进行识别,更为准确的说就是:测试集中含有训练集中没有的类别,而在使用测试集进行测试的时候,输入一张不属于训练集中已知类别的图像,由于Softmax的输出特性,模型有可能会将其以较高的

Android AlarmClock ACTION_SET_ALARM Intent 产生异常

给定的示例产生异常(android.content.ActivityNotFoundException:找不到处理Intent的Activity)Intenti=newIntent(AlarmClock.ACTION_SET_ALARM);i.putExtra(AlarmClock.EXTRA_MESSAGE,"NewAlarm");i.putExtra(AlarmClock.EXTRA_HOUR,hours);i.putExtra(AlarmClock.EXTRA_MINUTES,mins);startActivity(i);在我的SGS2Android版本2.3.3上。你有什么想法

android - View.findViewById() 返回 null

我有这个代码:privatevoidinflateMenu(){if(menu==null){mFanView=(LinearLayout)findViewById(R.id.fanView);finalViewv=LayoutInflater.from(getContext()).inflate(R.layout.sidemenu,mFanView);menu=(MenuView)v.findViewById(R.id.listViewMenu);}menu.setColors(backgroundColor,selectedColor,unselectedColor);}调试时,v

android - Intent 始终为 null onStartCommand

我有以下代码@OverridepublicintonStartCommand(Intentintent,intflags,intstartId){if(intent!=null){Log.i("INTENT",intent.getAction().toString());}returnSTART_STICKY;}但它总是在线返回NullPointerException:Log.i("INTENT",intent.getAction().toString());为什么?我在上面检查“intent”变量是否不为空。如果是这种情况,请执行以下代码。但我仍然遇到nullpointerexcep

java - Android:当我传递 Null 时,构造函数是不明确的,但当我传递分配给 Null 的变量时则不是

这个问题在这里已经有了答案:Howtodomethodoverloadingfornullargument?(7个答案)关闭8年前。我写了下面的语句来创建一个ArrayAdapter,ArrayAdapterarrayListAdapter=newArrayAdapter(getActivity(),R.layout.fragment_result_titles,R.layout.row_listview,arrayList);但是我得到了构造函数调用不明确的错误。我理解传递null时,不清楚ArrayAdapter(Contextcontext,intresource,inttext