草庐IT

azure-virtual-machine

全部标签

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

我的Android项目总是出错。java.lang.NullPointerException:Attempttoinvokevirtualmethod'android.view.Viewandroid.app.Activity.findViewById(int)'onanullobjectreference在我的MainActivity中,我调用了FragmentStart类。FragmentStart.classimportandroid.app.Activity;importandroid.content.Intent;importandroid.os.Bundle;importa

android - 空指针异常 : Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference

我是Fragments和自定义ListView适配器的新手。谁能帮帮我吗?我有我的Fragment我有我的ListViewpublicclassRecordingListFragmentextendsFragmentimplementsOnItemClickListener{ListViewmListView;TextViewemptyView;Buttonoptions,delete,edit;ArrayListrecordings=null;RecordingsListAdaptermAdapter;publicRecordingListFragment(){}@Overridep

android - java.lang.NullPointerException : Attempt to invoke virtual method 'java.io.File com.parse.ParsePlugins.getParseDir()' on a null object reference 异常

试图从Parse加载一个类,但是应用程序在我启动它时崩溃了!这是代码:ListViewlistview;Listob;ProgressDialogmProgressDialog;ArrayAdapteradapter;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_big_board);newRemoteDataTask().execute();}privateclassRemoteDa

安卓 AllJoyn : Connection with second machine gives error of BusAttachement

我已经为两种不同的传感器开发了应用程序。它们单独工作正常,但是当我尝试将它们组合在一起并创建两个不同的总线时,Alljoyn给出了这个异常。org.alljoyn.services.common.BusAlreadyExistException:TheobjecthasbeensetpreviouslywithaBusAttachment.下面是我的连接源代码。谁能告诉我为什么会遇到这个问题。privatevoidconnect(){org.alljoyn.bus.alljoyn.DaemonInit.PrepareDaemon(getApplicationContext());bus

android - 空指针异常 : Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()'

publicclassCategoryAdapterextendsBaseAdapter{Contextcontext;ArrayListmodel;LayoutInflaterlayoutInflater;publicCategoryAdapter(Activityactivity,ArrayListmodel){this.model=model;this.context=activity;}@OverridepublicintgetCount(){returnmodel.size();}@OverridepublicObjectgetItem(intposition){return

android - 了解 Android "Radio State Machine"以获得更好的电池生命周期

在Android文档页面上OptimizingDownloadsforEfficientNetworkAccess,要点是“唤醒radio不好”、“批量传输”或“搭载GCM”。那篇文章为好奇的人留下了一些内部工作原理:它说“每次您创建新的网络连接时,radio都会转换到全功率状态。”connection这里是什么意思?那是TCP连接吗?这是否意味着发送UDP数据包不会唤醒radio?Standby表示:“待机:最低能量状态,在此期间没有Activity或不需要网络连接。”这是否意味着网络模块已完全关闭?如果是这样,即使设备处于sleep模式,GCM又如何工作?如果不是,与全功率模式相比

android - 由 java.lang.NullPointerException : Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference 引起

我有BitmapScalingHelper.java:publicclassBitmapScalingHelper{publicstaticBitmapdecodeResource(Resourcesres,intresId,intdstWidth,intdstHeight){Optionsoptions=newOptions();options.inJustDecodeBounds=true;BitmapFactory.decodeResource(res,resId,options);options.inJustDecodeBounds=false;options.inSample

android - Qt 安卓 : Virtual keyboard keeps switching to uppercase when I type in a QLineEdit

当我输入QLineEdit时,虚拟键盘以大写字母开头。即使我将它设置为小写,只要我输入一个字符,它就会恢复为大写。也就是说,每次我键入一个字符时,键盘都会再次重置为大写。这甚至发生在新创建的项目(我只是进行了行编辑并运行它)。我发现了一个关于同一问题的论坛帖子-https://groups.google.com/forum/#!topic/android-qt/QMFZmkACAIA.我使用的是Qt/C++(不是QML)。编辑:刚刚在一个新的QML项目上测试了它,错误也在那里。我还发现了一个关于QML的帖子-https://groups.google.com/forum/#!msg/a

c++ - extern "C"变量名 "virtual"

我正在尝试创建一个基于Qt5.1配置KMS功能测试(qtbase/config.tests/qpa/kms)的简单C++测试应用程序,但它失败了。该应用程序非常简单,如下所示:#includeextern"C"{#include#include#include"xf86drm.h"}#include#includeintmain(int,char**){//Checkforgbm_surfacewhichisquitearecentaddition.gbm_surface*surface=0;return0;}问题是当包含“libdrm/xf86drmMode.h”或“libdrm/x

c++ - 我想我已经重写了一个虚拟方法,但我仍然得到 : "X must implement the inherited pure virtual method Y"

我正在尝试用C++为我正在编写的游戏实现一个接口(interface),但我运行时出错。这是我创建的接口(interface)及其子类://Attack.h//definesasetofvaluesassociatedwithallattacks//andaninterfaceforallattackstypedefunsignedconstintattack_type;typedefunsignedconstintp_attack_type;//definestheattacktypesstaticconstattack_typeNORMAL=0;staticconstattack_