I have a flow that goes MainActivity -> StoriesActivity -> StoryBodyActivity.  Each passes variables to the next using Intents.  I'm trying to implement a back button from StoryBodyActivity to StoriesActivity, but it's throwing a NullPointerException on authorID = extras.getInt("author_id"); in StoriesActivity.  I know what a NullPointer is. I just don't know how to fix this one! Could it be because it no longer has access to the data that was passed from the MainActivity?  Note: This works fine when clicking the back button on the device, just not the icon on the ActionBar.  Snippet from StoryBodyActivity:  @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_story_body);          getSupportActionBar().setDisplayHomeAsUpEnabled(true); }  @Override     public boolean onOptionsItemSelected(MenuItem item) {         switch (item.getItemId()) {             // Respond to the action bar's Up/Home button             case android.R.id.home:                 NavUtils.navigateUpFromSameTask(this);                 return true;         }         return super.onOptionsItemSelected(item);     }   Snippet from StoriesActivity:  private int authorID;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_stories);          Bundle extras = getIntent().getExtras();          authorID = extras.getInt("author_id"); // NullPointerException here         final String authorName = extras.getString("author_name");         Log.i("click", Integer.toString(authorID)); }   Snippet from MainActivity:  Intent intent = new Intent(MainActivity.this, StoriesActivity.class); intent.putExtra("author_id", author.getID()); intent.putExtra("author_name", author.getName()); startActivity(intent);   Snippet from AndroidManifest:  &lt;application         android:allowBackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:roundIcon="@mipmap/ic_launcher_round"         android:supportsRtl="true"         android:theme="@style/AppTheme"&gt;          &lt;activity             android:name=".MainActivity" android:theme="@style/AppTheme.NoActionBar" &gt;             &lt;intent-filter&gt;                 &lt;action android:name="android.intent.action.MAIN" /&gt;                 &lt;category android:name="android.intent.category.LAUNCHER" /&gt;             &lt;/intent-filter&gt;         &lt;/activity&gt;          &lt;activity             android:name=".StoriesActivity"             android:theme="@style/AppTheme.NoActionBar" /&gt;          &lt;activity             android:name=".StoryBodyActivity"             android:theme="@style/AppTheme"             android:parentActivityName="com.example.apple.bookshelf.StoriesActivity"&gt;         &lt;meta-data             android:name="android.support.PARENT_ACTIVITY"             android:value="com.example.apple.bookshelf.StoriesActivity" /&gt;         &lt;/activity&gt;      &lt;/application&gt;
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?
Does Airplane Mode allow GPS location to pass through? This is what I saw when my plane was taxing to the runway at CDG:     Airplane mode was on and all other transmissions (except Location), including WiFi, mobile data, NFC and Bluetooth were off.  Location was not manually turned on by me, after I enabled Airplane Mode. It remained turned on.  What am I missing? Is GPS now so widely accepted on-board planes that Android changed its configuration to let this kind of signal/communication to pass through Airplane mode "block"?  I believe that  isn't a duplicate, because at that time (2016) Location was generally "included" in Airplane mode and was turned off by enabling it. I just ran into the problem of embedding fonts while trying to publish with lulu.com. Although everyone apparently is 'supposed' to handle those 35 standard fonts for some strange reason they won't accept pdf's without them included. So one way that according to  is supposed to work (I haven't tried yet, but hopefully it does work) is to convert the pdf to ps and then back to pdf and include the fonts at that time:  pdftops file.pdf ps2pdf14 -dPDFSETTINGS=/prepress file.ps   But this feels at least to me like the wrong way of doing things. Is there some way of passing the parameter directly to pdflatex to tell it to embed those fonts?   And, if not -- How do we go about getting such a feature? (Because it can't only be me who has this sort of problems) Placement of varistor with respect to fuse My design includes a pretty standard AC/DC converter powered by mains for intended use at home. For overvoltage and overcurrent protection, I am planning to use a combination of varistor and fuse placed before the power converter.  I understand it is good practice to put the fuse before the varistor - in an overvoltage event, the varistor will draw a large current that may blow the fuse, protecting the rest of the circuit and even the upstream circuitry.  However, due to extremely tight layout, it is very hard to put the fuse before the varistor.  What risk am I running if I put the varistor before the fuse?  What if I put a second fuse in series with the varistor? Does it negate the varistor's protection of the downstream circuit? What does "restricted \write18 enabled" mean and why does TexLive keep reporting it? How do I echo and send console output to a file in a bat script? The most efficient way to implement an integer based power function pow(int, int) What is the most efficient way given to raise an integer to the power of another integer in C?  // 2^3 pow(2,3) == 8  // 5^5 pow(5,5) == 3125 system of ode with non-constant coefficient matrix JavaScript window resize event I have not idea how to approach this differential equation.   $$y'-\int_0^xy(t)dt=2$$.  Basically, I did,  $$F''(t)-F(x)+F(0)=2 \;\;\;\;\;\;\; F'=y$$  I am stuck.  Thank You. For a while now I've noticed that if I take a cup of hot tea and pour it into two cups and leave it then both cups will cool faster than the single cup.  How is it that nature cools two cups of tea in parallel more quickly? It's still the same amount of tea but it gets cooled quicker if I have two cups. How to have separated but vinculated multiple Ubuntu One accounts? When exactly can a caster stop concentrating on a spell? Comment on Duplicate Reference: Why would this be marked duplicate when it was asked years prior to the question referenced as a duplicate?  I also believe the question, detail, and response is much better than the referenced question.  I've been a C++ programmer for quite a while but I'm new to Java and new to Eclipse.  I want to use the  to visualize some data I'm working with.  This code is organized like this:  ./com ./com/touchgraph ./com/touchgraph/graphlayout ./com/touchgraph/graphlayout/Edge.java ./com/touchgraph/graphlayout/GLPanel.java ./com/touchgraph/graphlayout/graphelements ./com/touchgraph/graphlayout/graphelements/GESUtils.java ./com/touchgraph/graphlayout/graphelements/GraphEltSet.java ./com/touchgraph/graphlayout/graphelements/ImmutableGraphEltSet.java ./com/touchgraph/graphlayout/graphelements/Locality.java ./com/touchgraph/graphlayout/graphelements/TGForEachEdge.java ./com/touchgraph/graphlayout/graphelements/TGForEachNode.java ./com/touchgraph/graphlayout/graphelements/TGForEachNodePair.java ./com/touchgraph/graphlayout/graphelements/TGNodeQueue.java ./com/touchgraph/graphlayout/graphelements/VisibleLocality.java ./com/touchgraph/graphlayout/GraphLayoutApplet.java ./com/touchgraph/graphlayout/GraphListener.java ./com/touchgraph/graphlayout/interaction ./com/touchgraph/graphlayout/interaction/DragAddUI.java ./com/touchgraph/graphlayout/interaction/DragMultiselectUI.java ./com/touchgraph/graphlayout/interaction/DragNodeUI.java ./com/touchgraph/graphlayout/interaction/GLEditUI.java ./com/touchgraph/graphlayout/interaction/GLNavigateUI.java ./com/touchgraph/graphlayout/interaction/HVRotateDragUI.java ./com/touchgraph/graphlayout/interaction/HVScroll.java ./com/touchgraph/graphlayout/interaction/HyperScroll.java ./com/touchgraph/graphlayout/interaction/LocalityScroll.java ./com/touchgraph/graphlayout/interaction/RotateScroll.java ./com/touchgraph/graphlayout/interaction/TGAbstractClickUI.java ./com/touchgraph/graphlayout/interaction/TGAbstractDragUI.java ./com/touchgraph/graphlayout/interaction/TGAbstractMouseMotionUI.java ./com/touchgraph/graphlayout/interaction/TGAbstractMousePausedUI.java ./com/touchgraph/graphlayout/interaction/TGSelfDeactivatingUI.java ./com/touchgraph/graphlayout/interaction/TGUIManager.java ./com/touchgraph/graphlayout/interaction/TGUserInterface.java ./com/touchgraph/graphlayout/interaction/ZoomScroll.java ./com/touchgraph/graphlayout/LocalityUtils.java ./com/touchgraph/graphlayout/Node.java ./com/touchgraph/graphlayout/TGAbstractLens.java ./com/touchgraph/graphlayout/TGException.java ./com/touchgraph/graphlayout/TGLayout.java ./com/touchgraph/graphlayout/TGLensSet.java ./com/touchgraph/graphlayout/TGPaintListener.java ./com/touchgraph/graphlayout/TGPanel.java ./com/touchgraph/graphlayout/TGPoint2D.java ./com/touchgraph/graphlayout/TGScrollPane.java ./TG-APACHE-LICENSE.txt ./TGGL ReleaseNotes.txt ./TGGraphLayout.html ./TGGraphLayout.jar   How do I add this project in Eclipse and get it compiling and running quickly? Cardioid in coffee mug? How to draw a torus Is there an easy way to draw a contour image of torus below with tikz? Or for that matter with any other graphics package. What is the relationship between redshift and conformal time ?   For example in a paper i found:   taking $z_e = 3234 $ at the time of radiaton-matter equality yields the conformal time $\frac{\eta_e}{\eta_0} = 0.007$ and taking $z_E=0.39$ at matter-$\Lambda$ equality yields $\frac{\eta_E}{\eta_0}=0.894$ and setting redshift at decoupling $z_d=1089$ yields $\frac{\eta_d}{\eta_0} = 0.0195$  where $\eta_0$ is the present decoupling time.  Further some cosmological parameters are given as :  $\Omega_r = 8.36 \times 10^{-5}, \Omega_m = \Omega_b + \Omega_{dm} = 0.044 +0.226, \Omega_\Lambda = 0.73,  H_0=0.72$  Now how can i calculate all those $\eta_e, \eta_E, \eta_d, \eta_0$ from given redshift values and/or above parameters ? I searched whole of my text books trying to find an explicit relation for conformal time $\eta$ but all i got was $ \mathrm{d}t=a(t)\mathrm{d}\eta$. Any help would be very helpful. Good Afternoon all,  I am trying to typeset a symbol that I have been using to represent the integral of a regulated function. This symbol is the standard integral symbol, with the letter "R" superimposed on it.  I have tried using \mathllap, \mathclap and \mathrlap (as suggested ), however none of these have managed to give the desired effect. When I tried doing it without the limits of integration, it got close to working, however then I was unable to have the limits to the right hand side of the symbol:  \mathop{\mathrlap{\int}R}_a^b f   Any help would be greatly appreciated, thank you in advance!  Minimal Example:  \documentclass{article}  \usepackage{amsmath,mathtools}  \begin{document}  Take the regulated function $f$, we want to compare the Riemann integral, $\int_a^b f$ to the regulated integral $\mathop{\mathrlap{\int}R}_a^b f$ by taking sequences of step functions.  We will prove that $$ \mathop{\mathrlap{\int}R}_a^b f = \int_a^b f $$  \end{document} Whenever Ubuntu boots up, a dialogue pops up asking me to unlock my default keyring. Is there some way this can unlock automatically through PAM or some other magical way? Remove Meta Privilege for MSE (only) What I am asking here is to please remove the privilege to participate in Meta for MSE.  This privilege is literally useless. You can't really have a meta site for a meta site. There's no Meta.Meta.SE here or any other SE site out there: Meta.SE covers for every site in SE, including itself.     When users find out that you don't really get anything new, it's kinda sad for those people. There is no use for it except just to be there and fill up the space between the first and third privilege. Privileges should be shown only if you earn something new, and this privilege to participate in the meta isn't new because it's where you report problems in all of SE, including Meta.SE.    So please remove the privilege to participate in meta just for Meta.SE.    This is not a dupe as this is a feature-request to remove it, not support on why it is there. /var/log/syslog constantly logging errors, growing at 1 MB/s It seems to be the same three errors repeated:  $ tail -n15 /var/log/syslog Apr  5 23:32:01 detoo kernel: [ 6042.078785] ACPI Error: [PGRT] Namespace lookup failure, AE_NOT_FOUND (20150619/psargs-359) Apr  5 23:32:01 detoo kernel: [ 6042.078787] ACPI Error: Method parse/execution failed [\_GPE._L6F] (Node ffff8808554d42d0), AE_NOT_FOUND (20150619/psparse-536) Apr  5 23:32:01 detoo kernel: [ 6042.078788] ACPI Exception: AE_NOT_FOUND, while evaluating GPE method [_L6F] (20150619/evgpe-592)   I noticed something was wrong when I was getting low disk space warnings. I've flashed to the latest UEFI available, I've tried enabling/disabling the C states in my UEFI.  I'm running Linux Mint 17.3 Cinnamon 64-bit with kernel 4.2.0-34-generic. I have a skylake processor and z170 motherboard.  I'm quite new to linux and am at a lost as what I should do next.  EDIT: I have the same problem when booting from a USB with Ubuntu 16.04, and nearly identical error logs being constantly spammed:  Apr  6 01:01:48 ubuntu kernel: [  152.594053] ACPI Exception: AE_NOT_FOUND, while evaluating GPE method [_L6F] (20150930/evgpe-592) Apr  6 01:01:48 ubuntu kernel: [  152.594994] ACPI Error: [PGRT] Namespace lookup failure, AE_NOT_FOUND (20150930/psargs-359) Apr  6 01:01:48 ubuntu kernel: [  152.594996] ACPI Error: Method parse/execution failed [\_GPE._L6F] (Node ffff8808554e02d0), AE_NOT_FOUND (20150930/psparse-542)