The popup window has to be shown when the app is started. The function that calls the popup window is located in the OnCreate() method. When I start debugging the app it constantly crashes.      public void ShowPopup() {         dialog.setContentView(R.layout.mainactiv);        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));        dialog.show();     }   And this is the error message:  java.lang.RuntimeException: Unable to start activity ComponentInfo  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Dialog.setContentView(int)' on a null object reference
129
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
74634
I am trying to start share-point workflow using CSOM(Client side object model) by following means of code. But i got the following error from the line mark in comment. Please help me to figure out this error.     Error :- Cannot invoke method or retrieve property from null   object. Object returned by the following call stack is null.   "GetWorkflowDeploymentService new   Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager() "    public bool StartWorkFlow()  {     string workflowName = "UpdateDealStatus";     // connect to the workflow services via a CSOM client context    var workflowServicesManager = new WorkflowServicesManager(_sharepoint,                  _sharepoint.Web);    // connect to the deployment service    var workflowDeploymentService = workflowServicesManager.GetWorkflowDeploymentService();    // get all installed workflows   var publishedWorkflowDefinitions =    workflowDeploymentService.EnumerateDefinitions(true);             _sharepoint.Load(publishedWorkflowDefinitions);     try    {       _sharepoint.ExecuteQuery();//Error thrown from this line    }    catch (Exception ex)    {      }     // find the first workflow definition    var firstWorkflowDefinition = publishedWorkflowDefinitions.First();     // connect to the subscription service    var workflowSubscriptionService = workflowServicesManager.GetWorkflowSubscriptionService();     // get all workflow associations    var workflowAssociations = workflowSubscriptionService.EnumerateSubscriptionsByDefinition(firstWorkflowDefinition.Id);     _sharepoint.Load(workflowAssociations);    _sharepoint.ExecuteQuery();     foreach (var association in workflowAssociations)    {        Console.WriteLine("{0} - {1}",        association.Id, association.Name);    }     return true; }
77081
I downloaded the eclipse from its site. And extracted in home folder. For the first time when I opened it, it worked fine. Then I locked it to launcher. Now it's not starting when I click on launcher icon in eclipse but it starts when I start it from the folder where I extracted it. Please tell some way to keep it in launchcer and open it from t here only.  Thanks.  [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Name=Java - SnapdealOMS/src/main/java/com/snapdeal/oms/admin/web/controller/ReloadCacheController.java - Eclipse  Icon=eclipse.png Path=/home/nakulkumar/Downloads/eclipse Exec=/usr/bin/java -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -data /home/nakulkumar/Snapdeal_workspace -os linux -ws gtk -arch x86_64 -showsplash /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.platform_4.4.0.v20140925-0400/splash.bmp -launcher /home/nakulkumar/Downloads/eclipse/eclipse -name Eclipse --launcher.library /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326/eclipse_1605.so -startup /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar --launcher.appendVmargs -exitdata 34000f -product org.eclipse.epp.package.java.product -vm /usr/bin/java -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar /home/nakulkumar/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar StartupNotify=false StartupWMClass=Eclipse OnlyShowIn=Unity; X-UnityGenerated=true
12503
Related to .  Any advice on fixing the problem below?  After a lot of experimentation with the program, I have discovered several things.   It crashes relatively consistently (90% of the time or so) upon running the line of code, Set Message = New CAPICOM.EncryptedData.  Note that the line above this is merely Dim Message As CAPICOM.EncryptedData. The function that makes that call does not crash when called earlier in the program's execution.  Binary search for error does not work to find the problem, since calling the function in some places mysteriously, unreliably prevents the bug from happening.  Sometimes rebuilding the program seems to impact if the bug shows up.  Yes, it is a heisenbug.  The same issues apply with temporal binary search for error.  Spending 5 hours comparing two versions of the program only to discover that both versions have the bug even though only one of them is currently showing the symptoms is not very productive. The crash is due to an access violation 0xC00000005 Running WinDbg (the windows debugger) shows that there is only one line of code which reads this memory location, LoadPicture(szTmpBMP).  It is called at the end of a scary function which grabs the picture out of a resource and sticks it in a temp file.  I was scared enough of this function that, for the sake of testing, I replaced it with a call to LoadPicture("testcra.bmp"), then didn't call the scary resource function for that bitmap.  This did not help.  Removing this call to loadpicture entirely also did not help, though the debugger could no longer find any points where the affected memory was being read, and the affected memory was no longer at the same location.  This testing was done on a VM, so some memory reads are not necessarily going to be visible to the debugger. Everything works perfectly on Vista (both my local machine and a Vista VM).  The access violation only occurs on XP. I'm using VB6 Version 8176, 6.0.8169
27890
I need to take a screenshot that records my Eclipse IDE menu item status. For example, if I clicked the "Project" menu and there comes a list of menu items. I need to record those menu items.  The problem is when the menu item list window (which works like a context menu window) has the focus, the screenshot function is not working. I tried everything on this  and nothing works as long as the menu items window is opened. Any mouse click will close the context menu window, so I cannot use mouse either. However if there is no context menu window opened then screenshots works fine.  How can I record the screen with context menu window displayed?
52358
I'm writing an application that can be started either as a standard WinForms app or in unattended mode from the command-line. The application was built using the VS 2k5 standard WinForms template.  When the application is executed from the command-line, I want it to output information that can be captured by the script executing the application. When I do this directly from Console.WriteLine(), the output does not appear, although it can be captured by piping to a file.  On the other hand, I can force the application to pop up a second console by doing a P/Invoke on AllocConsole() from kernel32. This is not what I want, though. I want the output to appear in the same window the application was called from.  This is the salient code that allows me to pop up a console from the command line:  &lt;STAThread()&gt; Public Shared Sub Main()      If My.Application.CommandLineArgs.Count = 0 Then         Dim frm As New ISECMMParamUtilForm()         frm.ShowDialog()     Else         Try             ConsoleControl.AllocConsole()             Dim exMan As New UnattendedExecutionManager(ConvertArgs())             IsInConsoleMode = True             OutputMessage("Application started.")             If Not exMan.SetSettings() Then                 OutputMessage("Execution failed.")             End If         Catch ex As Exception             Console.WriteLine(ex.ToString())         Finally             ConsoleControl.FreeConsole()         End Try      End If  End Sub  Public Shared Sub OutputMessage(ByVal msg As String, Optional ByVal isError As Boolean = False)     Trace.WriteLine(msg)     If IsInConsoleMode Then         Console.WriteLine(msg)     End If      If isError Then         EventLog.WriteEntry("ISE CMM Param Util", msg, EventLogEntryType.Error)     Else         EventLog.WriteEntry("ISE CMM Param Util", msg, EventLogEntryType.Information)     End If  End Sub
7898
The StackExchange app crashes for me on every start when I click a link in the browser. It seems (based on the StackTrace) that the url parser causes a null pointer exception. I'm using 0.1.90.
81002
When a Java VM crashes with an EXCEPTION_ACCESS_VIOLATION and produces an hs_err_pidXXX.log file, what does that indicate? The error itself is basically a null pointer exception. Is it always caused by a bug in the JVM, or are there other causes like malfunctioning hardware or software conflicts?  Edit: there is a native component, this is an SWT application on win32.
10898
I want to start a modal operator by clicking a button in a panel in the properties region. It should then stop when I click somewhere in the 3D viewport. I want to execute some code when I start and finish the operator (see the code below). I tried modifiyng the modal operator template with an execute method to start the modal operator. But the now the context.space_data.type is always &quot;PROPERTIES&quot; because that's where the panel is located, I guess. Is this a bad way of doing what I want? class MY_OPERATOR_OT_click_on_3dview(bpy.types.Operator):          bl_idname = &quot;mesh.click_on_3dview&quot;     bl_label = &quot;Click on 3D&quot;      def modal(self, context, event):                  if context.space_data.type != 'VIEW_3D':             return {'PASS_THROUGH'}                  if event.type in {'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE'}:             # allow navigation             return {'PASS_THROUGH'}         elif event.type == 'LEFTMOUSE':             # DO ALL THE POST-SELECT STUFF             return {'FINISHED'}         elif event.type in {'RIGHTMOUSE', 'ESC'}:             return {'CANCELLED'}          return {'RUNNING_MODAL'}      def execute(self, context):         # DO ALL THE SETUP STUFF           context.window_manager.modal_handler_add(self)              return {'RUNNING_MODAL'}            def cancel(self, context):         print(&quot;CANCEL???&quot;)
8837
I need to force a selected application to start up each time my Android-based device is (re)started.  Is there anything I can use (configuration setting, external application etc.) to accomplish this task? Or is this kind of behavior limited to home screen managers only?
121233
I'm trying to run an application downloaded from the internet (e.g., Jabref) but it seems that it fails silently. When I try to open it by double clicking it, nothing happens. When I use the terminal I get the following message:     LSOpenURLsWithRole() failed with error -10810 for the file .../xxxx.app   I tried several suggestions that I found here like changing permissions and modifying the Info.plist file, but nothing works.  Because it's a Java application, I tried to run it through terminal using      java -cp "CLASSPATH" MAINCLASS    and it works fine.  Just to mention that I get this error not only with this app, but for a few other applications.  Thanks in advance.
7576
I have a lookup to a custom object called Project on my Opportunity object. I am trying to write a trigger that updates an Active, Awarded, and Title on the Project object whenever the Active, Awarded, or Title field is updated on Opportunity based some on more logic that isn't in my code below. This is my first trigger and needing a little help due to a NullPointerException where I try to set Project__r.Active__c = true. Any thoughts?      trigger ProjectFieldsTrigger on Opportunity (before insert, before update) {       //List&lt;Opportunity&gt; opp = [SELECT Name, Active__c, Funded__c, Title__c, Project__r.Name, Project__r.Active__c, Project__r.Awarded__c      //  FROM Opportunity WHERE Id IN :Trigger.New];      for(Opportunity o: Trigger.New){          if(o.Project__c != null){              if(o.Active__c == 'Y'){                 o.Project__r.Active__c = true;             }      }  }
97340
hi i'm trying to display a view in a popup but unable to get a solution. i tried   colorbox node module popup views integration module   Is there any better way to display a view as a popup ?
108842
I want to quickly try some Javascript code on Android phone.   I cannot find how to open console or something similar on either Chrome or default browser. about:debug doesn't do anything, and I don't want "remote debugging".   I can download another app if necessary (but I don't want to root my device).
11494
App version 1.0.27  If you the notification pane and click on the loading icon while it's spinning, the app will cause the app to crash.  03-26 22:51:08.331 E/AndroidRuntime(5927): FATAL EXCEPTION: main 03-26 22:51:08.331 E/AndroidRuntime(5927): java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1 03-26 22:51:08.331 E/AndroidRuntime(5927): at java.util.ArrayList.get(ArrayList.java:310) 03-26 22:51:08.331 E/AndroidRuntime(5927): at com.stackexchange.marvin.ui.BaseActivity$3.onItemClick(BaseActivity.java:266) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.widget.AdapterView.performItemClick(AdapterView.java:298) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.widget.AbsListView.performItemClick(AbsListView.java:1100) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2788) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.widget.AbsListView$1.run(AbsListView.java:3463) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.os.Handler.handleCallback(Handler.java:730) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.os.Handler.dispatchMessage(Handler.java:92) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.os.Looper.loop(Looper.java:137) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.app.ActivityThread.main(ActivityThread.java:5103) 03-26 22:51:08.331 E/AndroidRuntime(5927): at java.lang.reflect.Method.invokeNative(Native Method) 03-26 22:51:08.331 E/AndroidRuntime(5927): at java.lang.reflect.Method.invoke(Method.java:525) 03-26 22:51:08.331 E/AndroidRuntime(5927): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 03-26 22:51:08.331 E/AndroidRuntime(5927): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 03-26 22:51:08.331 E/AndroidRuntime(5927): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:126) 03-26 22:51:08.331 E/AndroidRuntime(5927): at dalvik.system.NativeStart.main(Native Method)   (Think I should calm down on finding bugs for a little while? :P)
120972
My application has javascript button that call Apex code.  Exceptions from web services are sometimes thrown and the user is shown a detailed exception message like this:  A problem with the OnClick JavaScript for this button or link was encountered: {faultcode:'soapenv:Client', faultstring:'HttpException: Example Error Message Class.BananaWebService.fetchBanana: line 22, column 1', }   Is there a simple way to create friendly error messages for my users when exceptions are thrown like this:  Example Error Message   Exception Class  public class HttpException extends Exception{}   Web Service Class   @RestResource(urlMapping='/BananaWebService/*') global class BananaWebService {   webservice static void fetchBanana(Id accountId) {      throw new HttpException('Example Error Message');   } }   Javascript code   {!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")}  {!REQUIRESCRIPT("/soap/ajax/28.0/apex.js")}   var accountId = "{!Account.Id}"; sforce.apex.execute("BananaWebService","fetchBanana", { accountId: accountId });  window.location.reload();
23314
I need to implement alert popup on standard page layout on click of standard button "Save".How can i achieve it.I tried google but not getting a valid implementation.Any idea would be much appreciated.