java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference When i try to click on the button several time then i encountered this error. Below are the error in logcat: E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.example.huiiy.myapplication, PID: 3933     java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference         at com.example.huiiy.myapplication.Activity9$13.onClick(Activity9.java:288)         at android.view.View.performClick(View.java:5712)         at android.view.View$PerformClick.run(View.java:22514)         at android.os.Handler.handleCallback(Handler.java:751)         at android.os.Handler.dispatchMessage(Handler.java:95)         at android.os.Looper.loop(Looper.java:154)         at android.app.ActivityThread.main(ActivityThread.java:6141)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)  Below are the coding of my application:     iv_33.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View view) {             MediaPlayer ivbsound = new MediaPlayer();             ivbsound = MediaPlayer.create(Activity9.this,R.raw.ivbutton);             //          MediaPlayer ivbsound = MediaPlayer.create(Activity9.this,R.raw.ivbutton);             ivbsound.start();             int theCard = Integer.parseInt((String) view.getTag());             doStuff(iv_33, theCard);         }     });
What is a NullPointerException, and how do I fix it? 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?
Why didn't the basilisk bite in Chamber of Secrets destroy the Horcrux? As the title asks, why didn't the basilisk bite received in the Chamber of Secrets destroy the Horcrux inside the bitten person?   Yes, I know Fawkes quite quickly healed the bite wound with his phoenix tears, but when Harry used the basilisk fang to destroy Tom Riddle's diary the destruction of that Horcrux was immediate. When Ron hit the locket with the Sword of Gryffindor, it was destroyed immediately. Although the destruction of the ring occurred off-page, Dumbledore used the Sword of Gryffindor to destroy it, so presumably, like the locket, it was gone right away. Nagini died straightaway when Neville decapitated her. The destruction of the Hufflepuff cup happens off-page. The diadem seems to have been destroyed by Fiendfyre immediately as well, as when Harry examined it outside the Room of Requirement it was already leaking a blood-like substance, and then it cracked in half. When Voldemort hit Harry with Avada Kedavra in the forest, Harry woke up in limbo with the last fragment of Voldemort's soul - that awful flayed baby-like being - separated from him immediately.   Is there a logical/canon-based explanation for why the fragment of Voldemort's soul residing in Harry wasn't destroyed upon Harry being bitten by the basilisk?  NOTE: I've read the HP Wiki's entry on Horcruxes; however, I find the HP Wiki to be inconsistent in its accuracy, so I'm hesitant to accept the Wiki's explanation on the matter. I'd prefer an explanation constructed from information in the books or a statement by JKR, or the like. I have an iOS application - an alarm clock. I released it a little over a month ago. Initially it was paid, but when I saw there were virtually no purchases (from 0 to 4 a day), I changed it to be free for a period of time. When it become free, in less than 10 days it has been downloaded more than 30,000 times, and more importantly (I think) it moved much higher in the search results when the user searches "alarm" - it reached 20th place in the results. During that time I also received very good reviews in the AppStore. But today I changed it back to paid, and now when I search "alarm" my app is shown at the bottom of the 4TH PAGE. Given that one page contains 120 apps, this is very bad for me and I don't understand why this happened. Can anyone tell me how does AppStore ranks search results and is there a way to move my app higher in the rankings, please? :) Huge thanks! Why can't we use double pointer to represent two dimensional arrays? Labeling all sides of the matrix with kbordermatrix I have a matrix with labels on the left and top. Now I want to have a label on all sides of the matrix. How can I change my code?  \documentclass[10 pt, a4paper, leqno, oneside] {report} \usepackage{kbordermatrix} \begin{document}  \renewcommand{\kbldelim}{(}% Left delimiter \renewcommand{\kbrdelim}{)}% Right delimiter \[   \tilde{\textbf{m}} = \kbordermatrix{     \mbox{} &amp; c_1 &amp; c_2 &amp; c_3 &amp; c_4 &amp; c_5 \\     % &amp; c_1 &amp; c_2 &amp; c_3 &amp; c_4 &amp; c_5 \\     r_1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 \\     r_2 &amp; 0 &amp; 1 &amp; 0 &amp; 0 &amp; 1 \\     r_3 &amp; 0 &amp; 0 &amp; 1 &amp; 0 &amp; 1 \\     r_4 &amp; 0 &amp; 0 &amp; 0 &amp; 1 &amp; 1 \\     r_5 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 1    } \]  \end{document} 1-1 correspondence between [0,1] and [0,1) Ubuntu does not offers me "install alongside Windows" Any of the partitions makes in Windows was not recognised by Ubuntu, or Zorin OS, or LinuxMint. It's like a blank hard disc, 250 gb free. I'm a new Linux user, but what confuses me is that I was able to install Ubuntu alongside Windows on my laptop with no problems, but on PC... no way! Is it possible to find the origin of a virus? Is there any method with which you can determine the origin for a given piece of malware in Windows?  One of my PCs was recently infected with the  password stealing trojan. Is there any way to tell from what source this virus was downloaded from? So I have seen the similar question and answers on here for $x^4 +1$, but I am having trouble extending anything there to this polynomial... I understand it is fairly trivial with Galois theory, but my class has just barely covered Field Extensions, so suffice it to say we have no Galois theory to play with.  I managed to prove it for the primes such that $p \equiv 1, 7 \pmod 8$, by noting that $2$ is a square modulo those primes and thus $x^4 - 2x^2 +1 = (x^2 -1 + 2qx)(x^2 - 1 - 2qx)$ for those $\mathbb{Z}_p$... however, trying to get a similar result for $3 \pmod 8$ and $5 \pmod 8$ has been stumping me for a long time, I am having a hard time making $q^2 = -1$ and $q^2 = -2$ give me something factorable...  I guess the worst part of all of this is that I don't think this solution is even particularly enlightening, in terms of abstract algebra. It's really just some number theory trickery. I don't think my course has prepared me theoretically for this problem, does anyone have an elementary approach to it? Proof that $(x-1)^2$ divides a $nx^{n+1} – (n+1)x^{n}+1$ I want to solve:  Show that, in $\mathbb Q[x]$ (rationals), the polynomial $(x-1)^2$ divides a $zx^{z+1} – (z+1)x^{z}+1$, where $z \geq 1$ is any integer  I am really lost with this one, don't know how to aproach it Evaluate $\mathop {\lim }\limits_{x \to 0} \left( {{1 \over {{{\sin }^2}x}} - {1 \over {{x^2}}}} \right)$ I tried l'Hospital but that will require a lot (and I mean A LOT!!!) of differentiating  Is there a shortcut? $$\mathop {\lim }\limits_{x \to 0} \left( {{1 \over {{{\sin }^2}x}} - {1 \over {{x^2}}}} \right)$$  Thanks in advance Crash or "segmentation fault" when data is copied/scanned/read to an uninitialized pointer Filling NoData gaps in raster using ArcGIS Desktop? Is $0 \, \mathrm m = 0 \, \mathrm s = 0 \,\mathrm {kg} = 0$? How do we define $[0 \, \mathrm m]$?  I once was given an assignment where I was asked to deduce and write down some physical quantity. It turned out that this quantity was $0$ in one unit or another, so I decided to drop the physical units because I figured that it didn't matter anyhow.  But I got to thinking:  If $0 \, \mathrm m = 0$, then we could add units of different dimensions (an operation not normally defined) like so: $5 + 0 \,\mathrm m = 5$.   Does $[ \cdot ]$ map $0 \, \mathrm m$ to both $0$ and $L$? Is there an established regime of thinking about physical quantities as an abstract algebra? Perhaps as a vector space where formal sums such as $5 \, \mathrm m + 10 \, \mathrm s$ are allowed? Would it be improper to drop the units of measurement of $0 \,\mathrm m$ like this in an academic paper? How to ensure that string interpolated into `sed` substitution escapes all metachars I am not a native English speaker, I usually hear “something caught my eye” but never “something caught (both) my eyes”. This seems pretty strange to me.  Cambridge Dictionaries Online provide these examples but without any explanation        (i) to get someone's ​attention:   A ​sudden ​movement ​caught my ​eye.        (ii) to get someone's ​attention, ​especially by ​looking at them:   I ​tried to catch the waiter's ​eye, so we could ​order.        (iii) to be ​attractive or different enough to be ​noticed by someone:   It was the ​unusual ​colour of his ​jacket that ​caught my ​eye.   Why is only one eye ‘caught”? Doesn't something catch our sight? We normally see with both eyes, not with one. Which is the best workflow to follow when texturing and importing textures from Substance Painter? So, I'm planning to texture a model using Substance Painter and will render it using the Cycles Render Engine. I will be also using the Principle Shader, heavily, to achieve realistic renders. So, which workflow in Substance Painter so that the textures are accurately rendered in Blender? Specular-Glossy? Or should I go with Metalic-Roughness? how to not commence a command depending on player health? Why do some websites show the company name next to the URL? Some websites show the company name next to the URL (in Chrome) and some don't.  How do I set this up for my website? Is there a reason why or why I wouldn't want to do this? trying to install libgraph Intutitive meaning behind the formal definition of sufficient statistic? According to the definition of sufficiency, a statistic is sufficient for a parameter if the conditional distribution of $X$ given a value of statistic does not depend upon the parameter.   What I am trying to understand is how does conditional distribution of $X$ not being a function of the parameter fit into the intuitive meaning of sufficiency i.e statistic value holding the same amount of information as that of the respective sample.