草庐IT

Wzero-as-null-pointer-constant

全部标签

android - 将 setError 属性设置为 null 后,TextInputLayout 删除了 EditText 样式

我想在我的新应用中使用TextInputLayout。我有这样的布局******在我的Activity中,我有如下验证:privatebooleanvalidatePassword(){if(inputPassword.getText().toString().trim().isEmpty()){inputLayoutPassword.setError(getString(R.string.err_msg_password));requestFocus(inputPassword);returnfalse;}else{inputLayoutPassword.setError(null)

java - Android getParentFragment() 在 fragment 内的 ViewPager 中返回 null

我有一个Activity,它包含一个带有ViewPager的Fragment。然后我在ViewPager中调用一个Fragment的方法。但是,如果该fragment随后调用getParentFragment(),它将返回null。为什么getParentFragment()为空?包含ViewPager的主要fragment:publicclassMyFragmentextendsFragment{privateTabLayoutmTabLayout;privateViewPagermViewPager;privateViewPagerAdaptermAdapter;@Override

android - activity.isFinishing 语句中的 BadTokenException : Unable to add window -- token null is not valid; is your activity running?

如果用户仍在当前Activity中,我有一个需要显示的弹出窗口,几秒钟后。我实现了stament检查Activity是否未完成/销毁然后显示弹出窗口,它工作正常,周末用户:)(从一个Activity慢慢点击到另一个Activity)但在高压测试中(Activity正在重新创建,完成,快速移动形式Activity到Activity)给我那个错误:E/UncaughtException:android.view.WindowManager$BadTokenException:Unabletoaddwindow--tokennullisnotvalid;isyouractivityrunni

论文笔记:NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis

1.主要目标:利用神经网络将多张多视角的2D图像进行3D重建,并进行渲染合成得到任意新视角的2D图像。2.动机:1、之前的方法通常使用Mesh,点云,体素等方式来对3D场景进行显式建模。但因为其是离散表示的,导致其生成结果不够精细化,且由于存储的三维场景的表达信息的数据集巨大,其对内存的消耗也限制了其在较高分辨率复杂场景的应用。2、通过使用一个复杂函数对3D场景进行隐式表达,同样可以完成3D信息的储存与新视角的合成。这样做的好处是可以通过函数对3D场景进行连续的表达,这使得生成的结果会更加精细;且在表达较高分辨率复杂场景时该方式消耗的内存较少。3.贡献:1、提出了一种将拥有复杂几何图形的连续场

android - onCreateContextMenu 被 ContextMenuInfo 的 null 值调用

我正在尝试使用上下文菜单。我已经使用SimpleCursorAdapter为简单的ListActivity成功完成了此操作。继续我想用CursorAdapter替换SimpleCursorAdapter但仍然保留ContextMenu行为,所以我添加了两个强制覆盖函数bindView和newViewpublicViewnewView(Contextcontext,Cursorcursor,ViewGroupparent){Viewview=mLayoutInflater.inflate(R.layout.check_row,parent,false);registerForContex

java - File.list() 为目录返回 null

执行代码时Filepath=newFile("/data");booleanisDir=path.isDirectory();//isDiristrueString[]fList=path.list();//fList==null!在Android2.3模拟器上,文件列表为空。这似乎与文档http://developer.android.com/reference/java/io/File.html#list中的声明相矛盾():Returnsnullifthisfileisnotadirectory.这里有什么问题吗? 最佳答案 您

android - SipDemo 管理器在设备 SamSung SII android SIP API 中始终为 null

最近尝试在android中使用SIPAPI,经过多次搜索,我找到了SipDemo(android-10的sampleproject)。我只是在Eclipse中导入项目。然而,当我在这个项目中寻找细节时(通过Log.e(...)),我发现SipManagermanager总是null甚至就在这一行之后:manager=SipManager.newInstance(this);。因此,无论我向SIP提供商注册什么,我都无法正常工作!有人有同样的问题吗?谁能给我一个建议?编辑:如果我使用linkhere,我可以让我的模拟器与register、call和receive一起工作。但是,对于我的设

android - Sherlock 操作栏 : findViewById(android. R.id.home)在 android 2.3 中返回 null

我正在为我的项目使用SherlockActionBar。但我面临问题。我在OnCreate方法中使用此代码。ActionBaractionBar=getSupportActionBar();actionBar.setHomeButtonEnabled(true);actionBar.setDisplayHomeAsUpEnabled(true);ViewiconImage=findViewById(android.R.id.home);iconImage.setPadding(100,0,0,0);在android4.1中,“iconImage”不为空。但是在安卓2.3上。iconIm

android - 为什么 TextToSpeech.getLanguage() *有时* 会返回 null?

在我的应用中,我调用了TextToSpeech.getLanguage()在实例化TextToSpeech之后很好(根据LogCat,大约800毫秒),但它有时(不总是)返回null,尽管在系统的TextToSpeech设置中正确设置了语言:SystemSettings>Language&input>Text-to-speechoutput>GoogleText-to-speech>English(UnitedKingdom)这只发生在JellyBean(Android4.1.1)中。它不会发生在Android2.2中。这是一个已知的Android错误吗?还是我做错了什么?顺便说一句,

android 蓝牙连接失败(isSocketAllowedBySecurityPolicy 开始 : device null)

我正在尝试用蓝牙连接两部手机(galaxynote1、galaxynote2),但套接字连接失败。这是我的LogCat:I/BluetoothService(24036):BEGINmConnectThreadD/BluetoothUtils(24036):isSocketAllowedBySecurityPolicystart:devicenullD/BluetoothService(24036):setState()2->1D/BluetoothService(24036):ConnectFailD/BluetoothService(24036):startV/BluetoothS