草庐IT

invoke-item

全部标签

android - java.lang.NullPointerException : Attempt to invoke interface method on a null object reference error on OnPostExecute() - AsyncTask 异常

我正在尝试从AsyncTask中获取结果以显示在我的搜索Activity中。我有一个来自以前应用程序的示例,它是在一位同事的帮助下制作的(我是那里的实习生)。我根据这个应用程序的需要调整了示例,但现在我得到了NullPointerException:03-0403:50:23.865:E/AndroidRuntime(8224):FATALEXCEPTION:main03-0403:50:23.865:E/AndroidRuntime(8224):Process:com.cyberdog.what2watch,PID:822403-0403:50:23.865:E/AndroidRun

java.lang.NullPointerException : Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference 异常

我有一个BlankFragmentpackagecom.hfad.addingafragmenttoframelayout;importandroid.os.Bundle;importandroid.support.v4.app.Fragment;importandroid.util.Log;importandroid.view.LayoutInflater;importandroid.view.View;importandroid.view.ViewGroup;importandroid.widget.TextView;importorg.w3c.dom.Text;/***Asimp

android - 如何从 Android 中的 arrays.xml 中的 <string-item> 列表中获取带有 java 代码的字符串数组?

我想从我们添加到androidvalues/文件夹中的arrays.xml文件中读取一个字符串数组。任何人都可以为此提供解决方案。否则,我将不得不在strings.xml中输入这些条目,并使用getResources()getString()将它们带到java代码中谢谢。塔林杜 最佳答案 getResources().getStringArray(R.array.umc_profile_values);工作了4个我! 关于android-如何从Android中的arrays.xml中的列

android - 工具 :text for RecyclerView items

我知道当你设置tools:text="Sampletext"在TextView中,您将在AndroidStudio的预览模式下看到示例文本,但不会在实际应用中看到。我想对RecyclerView中的项目执行此操作,但我似乎做不到。这是我到目前为止所做的:在RecyclerView(名为content_feed)中:tools:listitem="@layout/cell_feed"在单元格(名称cell_feed)中:tools:showIn="@layout/content_feed"这是xml文件:cell_feed.xmlcontent_feed.xml

java - 错误 :Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference

publicclassAlarmTaskimplementsRunnable{//ThedateselectedforthealarmprivatefinalCalendardate;//TheandroidsystemalarmmanagerprivatefinalAlarmManageram;//YourcontexttoretrievethealarmmanagerfromprivatefinalContextcontext;publicAlarmTask(Contextcontext,Calendardate){this.context=context;this.am=(Ala

Android:列表查看选中的item -1

当我尝试在我的ListView中获取已填充的选定项目位置时,我得到一个-1值。list.setOnItemClickListener(newAdapterView.OnItemClickListener(){publicvoidonItemClick(AdapterViewadapterView,Viewview,intarg2,longarg3){intselectedPosition=adapterView.getSelectedItemPosition();ShowAlert(String.valueOf(selectedPosition));}});为了填充我的ListView

android - 应用内购买 : Two devices with same account not getting same purchased items

我在尝试什么?在配置了X电子邮件地址的Android设备中购买商品。当我checkin配置了相同电子邮件地址的另一台设备时。但在第一台设备上购买的商品在另一台设备上不可用。我尝试了什么?我试过使用:inappBillingService.getPurchases(InAppBuyActivity.INAPPVERSION,getPackageName(),"inapp",null);还尝试使用:IabHelper.QueryInventoryFinishedListenermGotInventoryListener=newIabHelper.QueryInventoryFinished

android - 错误 : <item> inner element must either be a resource reference or empty

将Gradle升级到版本4后,我无法编译我的项目。AndroidStudio抛出错误:AndroidresourcecompilationfailedC:\Users\user\AndroidStudioProjects\grow_director_v2_net\app\build\intermediates\incremental\mergeDevDebugResources\merged.dir\values\values.xml:1475:error:innerelementmusteitherbearesourcereferenceorempty.C:\Users\user\A

android - 我的 "hal_process_report_ind: Bad item quality: 11"有什么值得担心的吗?

我在进行开发工作时在LogCat中遇到此错误。听起来像是硬件故障。是吗?它有什么关系?我尝试搜索,但发现只有谈论相机的人。它在摩托罗拉RazrM上。我的设备表现得很古怪(在玩游戏时解锁和暂时卡住时经常出现反馈延迟),我想知道这是否与它有关。谢谢!PIDTIDApplicationTagText698710qcom_sensors_halhal_process_report_ind:Baditemquality:11(有一些上下文)06-3009:32:52.693:D/PowerManagerService(698):acquireWakeLockflags=0x1tag=AlarmM

android - 回收站 View : Highlight selected item

我已经实现了一个RecyclerView并且我已经将它设置为使用CAB。但是如何突出显示所选项目?如果我检查了某个位置,我将其存储在SparseBooleanArray中。我的第一个想法是将包含所有元素的特定View存储在我的ViewHolder中,然后在onBindViewHolder中以某种方式将背景设置为:?android:attr/activatedBackgroundIndicator但是我该怎么做呢?这是一种有用的方法吗? 最佳答案 我终于通过简单地添加一些小东西解决了这个问题:首先,RecyclerView的items