here is my code   @Override public void onActivityResult(int requestCodeC, int resultCode, Intent data) {     // if this is the result of our camera image request         if (requestCodeC == CAMERA_REQUEST_CODE) {         // getting bitmap of the image         Bitmap photo = (Bitmap) Objects.requireNonNull( Objects.requireNonNull( data ).getExtras() ).get( &quot;data&quot; );         // displaying this bitmap in imageview         imageView.setImageBitmap( photo );    }      super.onActivityResult( requestCodeC, resultCode, data ); }  on back pressed while in camera activity the app crashes, I think this is because data is remaining null. How can I fix this? Thanks,
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?
37897
There are situations, where it is practical to have a type-cast return a null value instead of throwing a ClassCastException. C# has the as operator to do this. Is there something equivalent available in Java so you don't have to explicitly check for the ClassCastException?
108949
I have had my Nikon D3100 DSLR for about three years, and it has worked like a champ until today, when it started taking nothing but black pictures in any mode. The LCD screen still works (I can see pictures I took the other day that are still on the memory card), the viewfinder works, the EXIF data appears to be correct for each image, and yes, I took the lens cap off. No errors are given.  It does appear that the camera is actually taking pictures of something black, rather than a failed CCD or something like that. Looking at a few of the pictures on my computer, I can see that they're not completely black: they mostly display gradients from black at the top to very, very dark brown at the bottom. The grain pattern on each image is different, and the brown is slightly lighter on some images than on others.   To get a look at what's happening, I put the camera in manual mode, set a six-second exposure time, took the lens off, and looked into the camera body as I snapped a picture. The mirror flipped up and I could see the closed shutter curtain for the entire duration of the exposure.  I assume this means I have a stuck shutter? I've seen some indications around the web that this might be a common issue with this camera, but haven't seen much in the way of consistent solutions. Is this something I can fix myself, or do I have to get it repaired? How much is it likely to cost?  edit: As suggested, here are a couple of the riveting images:
95490
Why am I getting an out of memory exception?  So this dies in C# on the first time through:  splitBitmaps.Add(neededImage.Clone(rectDimensions, neededImage.PixelFormat));   Where splitBitmaps is a List&lt;BitMap&gt; BUT this works in VB for at least 4 iterations:  arlSplitBitmaps.Add(Image.Clone(rectDimensions, Image.PixelFormat))  Where arlSplitBitmaps is a simple array list.  (And yes I've tried arraylist in c#)  This is the fullsection:  for (Int32 splitIndex = 0; splitIndex &lt;= numberOfResultingImages - 1; splitIndex++) {    Rectangle rectDimensions;    if (splitIndex &lt; numberOfResultingImages - 1)    {     rectDimensions = new Rectangle(splitImageWidth * splitIndex, 0,        splitImageWidth, splitImageHeight);    }    else    {     rectDimensions = new Rectangle(splitImageWidth * splitIndex, 0,       sourceImageWidth - (splitImageWidth * splitIndex), splitImageHeight);    }     splitBitmaps.Add(neededImage.Clone(rectDimensions, neededImage.PixelFormat));    }   neededImage is a Bitmap by the way.   I can't find any useful answers on the intarweb, especially not why it works just fine in VB.  Update:  I actually found a reason (sort of) for this working but forgot to post it.  It has to do with converting the image to a bitmap instead of just trying to clone the raw image if I remember.
59807
How can I get crash data (stack traces at least) from my Android application? At least when working on my own device being retrieved by cable, but ideally from any instance of my application running on the wild so that I can improve it and make it more solid.
117538
I'm stumped.  All I need to do is open my photo, have the action stop to wait for me to decide where the crop should be (to center the important part of the photo), then close that photo so the batch processing can go get the next photo.  I see the "inset stop" is the key, but it never allows me to crop, it just moves on to the next photo.
23169
Attempted to use the Camera App today and was presented with a closed shutter screen in the Camera app as pictured below. No tramma or anything happend to the phone no recent OS update, just not working out of the blue.    If I open the FaceBook app and go to the "Take Picture" section, the camera opens successfully, but when I attempt to switch to the front camer, it goes back and gets stuck at the shut shutter screen.  What I have tried:   Quitting the "Camera" app and re-opening it Shutting down and restarting the iPhone. The force shutdown method, hold power + home button until it turns off. The Restore in iTunes   Still the same rear camera works, and when attempting to switch to the front camera boom closed shutter screen.  Any other ideas, it looks like I have a hardware problem...
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.
9169
I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace:  public function PrintStackTrace() {     try {         throw new Error('StackTrace');     } catch (e:Error) {         trace(e.getStackTrace());     } }   I like to know if there are other way to do this. In some place, the Error class creates the stack trace, but maybe it didn't do it with ActionScript 3.0 so maybe it's not posible, but i want to know.  Thanks!
72722
getRealPath() is returning the actual path in the local system, but returns null when deployed with a .war file.  &lt;%@ page import="java.io.*" %&gt; &lt;%@ page contentType="text/html;charset=ISO-8859-1" %&gt;  &lt;% int iLf = 10; char cLf = (char)iLf; String a= application.getResource("/"); //String myfile = application.getRealPath("/")+ "generate.xml"; //String myfile = request.getContextPath()+"generate.xml"; //String myfile = request.getRealPath("/")+"generate.xml";  out.println(myfile);     File outputFile = new File(myfile); outputFile.createNewFile(); FileWriter outfile = new FileWriter(outputFile); outfile.write(" &lt;?xml version='1.0' encoding='UTF-8'?&gt; "+cLf); outfile.write(" &lt;playlist version='1' xmlns = 'http://xspf.org/ns/0/' &gt; " +cLf); outfile.write(" &lt;title&gt;My Band Rocks Your Socks&lt;/title&gt; "+cLf);  outfile.write("&lt;trackList&gt;"+cLf);  %&gt;  &lt;%! String[] sports; %&gt;  &lt;%     sports = request.getParameterValues("sports");      out.println("&lt;html&gt;&lt;body&gt;&lt;h1&gt;hello&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;");      if (sports != null)     {           for (int i = 0; i &lt; sports.length; i++)          {                // outfile.writeln (sports[i]);                String total=sports[i];               String[] sa=total.split("[,]");               // String[] sub=new String();               outfile.write("&lt;track&gt;"+cLf);               for (int j=0;j&lt;sa.length;j++)               {                 // outfile.writeln(sa[j]);                 // outfile.writeln("sa["+j+"]="+sa[j]);                 if( j == 0)                 {                      outfile.write("&lt;location&gt;" + sa[0] +"&lt;/location&gt;"+cLf);                  }                 else if (j == 1)                      {                         outfile.write("&lt;image&gt;" + sa[1] +"&lt;/image&gt;"+cLf);                       }                      else if( j==2)                           {                             outfile.write("&lt;title&gt;" + sa[2] +"&lt;/title&gt;"+cLf);                           }                 }// end of inner for loop()                       outfile.write("&lt;/track&gt;"+cLf);          //outfile.writeln();       }// end of outer for()     }      //else outfile.writeln ("&lt;b&gt;none&lt;b&gt;");    outfile.write(" &lt;/trackList&gt; "+cLf);   outfile.write(" &lt;/playlist&gt; "+cLf);   outfile.close();    %&gt; &lt;object type="application/x-shockwave-flash" width="400" height="170"           data="xspf_player.swf?playlist_url=generate.xml"&gt;           &lt;param name="movie" value="xspf_player.swf?playlist_url=generate.xml" /&gt;  &lt;/object&gt;   Can anyone provide me with an alternative for this? It would be very helpful if you showed some sample code too.
116653
I have this:  If String.IsNullOrEmpty(editTransactionRow.pay_id.ToString()) = False Then     stTransactionPaymentID = editTransactionRow.pay_id 'Check for null value End If   Now, when editTransactionRow.pay_id is Null Visual Basic throws an exception. Is there something wrong with this code?
75620
From a technical perspective, what exactly is RAW and how does it differ from JPG or bitmap images? I'm not asking about the pros/cons versus another format, but rather what constitutes RAW format, how is the data stored, how does it differ from JPG (other than lack of compression), and how is it different than bitmap?
86318
I have created screenShot() method to take the screenshot of the web page. When I used this method in my code first time it will capture the screen and it will save the image with image1 name. When I used the same method screenShot() to capture screens for other pages with the use of this.screenShot(); this will again capture the current web page screen but it stores With the same name image1 in the same folder (which overrides to previously captured screen image1).  Now, I have to take screenshots for the number of web pages &amp; want to store it into the same folder with different names like image1, image2, image3...etc. by using the same method screenShot().  public void screenShot() throws IOException, InterruptedException {     File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);     File dest = new File("filPath/image1.png");     FileUtils.copyFile(scr, dest); }   Any workaround to achieve this scenario?
23707
Spent a half hour on this. Android 5.1.1 latest version SE app (Play Store won't let me update so latest).   Tried to upload photo into an answer. "Something went wrong".  Did tricks to reduce photo size to 275k -- same.    45k rep on the stack.  Here is the photo..... oh wait.  How do I solve?
34848
I used to use the implicit call of toString when wanting some debug info about an object, because in case of the object is null it does not throw an Exception.  For instance:    System.out.println("obj: "+obj);   instead of:  System.out.println("obj: "+obj.toString());   Is there any difference apart from the null case? Can the latter case work, when the former does not?  Edit: What exactly is done, in case of the implicit call?
94141
When I upload an image to Stack Overflow, I cannot see my JPEG file in my post. It's all blank. I've tried it with different files, but gotten the same result.
104346
What is the difference between hot, stuck, and dead pixels with regards to a camera's image sensor? What can cause each to occur? What can be done to reduce their influence on a photo?