Hi in the below where click on this fragment my list view getting null pointer.  If it is normal activity it is working fine.it is crashing my app  can any one please help me where i did the mistake.  public class HomeFragement extends Fragment {      EditText et_building;     TextView Add;     ListView lv;     ArrayList&lt;String&gt; arrayList;     ArrayAdapter&lt;String&gt; adapter;        public HomeFragement() {     }      @Override     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {          ((NavigationViewActivity) getActivity()).setActionBarTitle("ADD BUILDING");          View rootView = inflater.inflate(R.layout.activity_building, container, false);          init();          return rootView;     }      private void clickListener() {         Add.setOnClickListener (new View.OnClickListener ( ) {             @Override             public void onClick(View v) {                 String result=et_building.getText ().toString ();                 arrayList.add (result);                 adapter.notifyDataSetChanged ();              }         });     }      private void init() {         et_building=(EditText)getActivity ().findViewById (R.id.build_name);         Add=(TextView)getActivity ().findViewById (R.id.addbuild);         lv=(ListView)getActivity ().findViewById (R.id.list_building);         arrayList=new ArrayList&lt;String&gt; ();         adapter=new ArrayAdapter&lt;String&gt; (getActivity (),android.R.layout.simple_list_item_1,arrayList);         lv.setAdapter(adapter);         clickListener();     }
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?
What does active mean? What is the longest additional time ever used in Europe's top five leagues? Please mention the details of the match. I just refreshed the [iphone]-tag-site, and I'm seeing all kinds of questions with what appears to be a grey overlay (see image). What is this for/why am I seeing this? I have never seen anything like this before.. What does functools.wraps do? In a comment on this , someone said that they weren't sure what functools.wraps was doing. So, I'm asking this question so that there will be a record of it on StackOverflow for future reference: what does functools.wraps do, exactly? Uses of the 'Golden Ratio' I have heard much about the numerous appearances of the ratio found in nature: 1.6180339887.  Are there any actual mathematical uses that have been found of this number? What are its advantages? Just curiosity, really. How do I translate strings in Twig templates? I am working on a (my first) Drupal 8 project witch is a multilingual site. Drupal 8 really delivers in terms of native support for content translation.  However, I have a few strings set directly in some if the theme .Twig template files printed out like ex.   {{ 'Read more'|trans }}   I am really stuck on where to handle the translation for strings like these within the Drupal 8 installation.  What steps do I need to take to be able to translate these strings into the language currently selected for on the site? Do I need any additional modules other than the ones included in Drupal 8 core?  Steps I have taken:   Activated the Content Translation &amp; Interface Translation modules Added Twig strings like {{ 'Read more'|trans }} Flushed cache and refreshed pages containing the strings Checked admin/config/regional/translate for the strings with no result How to I make Cisco WebEx work with 13.10 64bit? I'm having a very hard time getting webex to work under Saucy.  Up until now I've been able to just install a java plugin, install ia32-libs, and I was good to go.  With Saucy ia32-libs is gone and it's up to us to figure out which 32-bit libraries we need to install.    So the question is, how do I install WebEx on 64bit Saucy without ia32-libs? executing web service using postman Gaps between arrows and labels CSS :after not adding content to certain elements Viruses in wine? Set the location in iPhone Simulator How can I set the location (as it's picked up in CoreLocation services) in the iPhone Simulator? Default constructor with empty brackets Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++?  MyObject  object;  // ok - default ctor MyObject  object(blah); // ok  MyObject  object();  // error   I seem to type "()" automatically everytime. Is there a good reason this isn't allowed? How to analyze trend in non-periodic time series Suppose I have following non-periodic time series. Obviously the trend is decreasing and I would like to prove it by some test (with p-value). I am unable to use classic linear regression due to strong temporal (serial) auto-correlation among values.  library(forecast) my.ts &lt;- ts(c(10,11,11.5,10,10.1,9,11,10,8,9,9,                6,5,5,4,3,3,2,1,2,4,4,2,1,1,0.5,1),             start = 1, end = 27,frequency = 1) plot(my.ts, col = "black", type = "p",      pch = 20, cex = 1.2, ylim = c(0,13)) # line of moving averages  lines(ma(my.ts,3),col="red", lty = 2, lwd = 2)     What are my options? What is in the space between a nucleus of an atom and its electrons? What test can I use to compare slopes from two or more regression models? I would like to test the difference in response of two variables to one predictor. Here is a minimal reproducible example.   library(nlme)  ## gls is used in the application; lm would suffice for this example m.set &lt;- gls(Sepal.Length ~ Petal.Width, data = iris,                 subset = Species == "setosa") m.vir &lt;- gls(Sepal.Length ~ Petal.Width, data = iris,                 subset = Species == "virginica") m.ver &lt;- gls(Sepal.Length ~ Petal.Width, data = iris,                 subset = Species == "versicolor")   I can see that the slope coefficients are different:  m.set$coefficients (Intercept) Petal.Width    4.7771775   0.9301727 m.vir$coefficients (Intercept) Petal.Width    5.2694172   0.6508306  m.ver$coefficients (Intercept) Petal.Width     4.044640    1.426365    I have three questions:   How can I test the difference between slopes? How can I test the difference between residual variances? What is a simple, effective way to present these comparisons?    A related question, , suggests re-running the model with a dummy variable to differentiate the slopes, are there options that would allow the use of independent data sets? Parse PHP code to extract function names? pgfplots external with large dataset (lualatex?) I have fairly large datasets with densely strucutred data that i cant downsampe much without loosing structure. I use TexMaker on Ubuntu 14.04LTS. I use   \usepackage{tikz,pgfplots,pgfplotstable} \pgfplotsset{compat=1.9} \usepgfplotslibrary{external} \tikzexternalize   and   \tikzsetnextfilename{figs/test1}   to externalize the figures. This works good compiling with pdflatex -shell-escape. But as the data becomes to large I am out of memory. I am trying to compile using LuaLaTeX -shell-escape instead of pdfLatex but get the following error message:   ! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interact ion=batchmode -jobname "figs/test1" "\def\tikzexternalrealjob{article}\input{ar ticle}"' did NOT result in a usable output file 'figs/test1' (expected one of . pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pd flatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed?   so pgfPlots seem to call pdfLatex without the appropriate -shell-escape flag and without me specifying it. How can i get this to compile in LuaLatex? or can i compile only the figures in LuaLatex and the rest in pdfLatex (the opposite of what is happening now)? I found  and  example but neither helped me...  Thankfull for help and i am also thankful for any general advice that can help me resolve the problem of ploting larger data sets in pgfplots.   Cheers /J Calculate the factorial of an arbitrarily large number, showing all the digits I can't seem to find an answer to this simple question, which I need for some compliance documentation.    On a default install of CentOS 6.5 (OpenSSH 5.3p1-94.el6), after how long of being idle will a user's SSH session be terminated?  I believe the following can be set to increase the idle timeout, but they are commented out by default.  $ grep -i alive /etc/ssh/sshd_config #TCPKeepAlive yes #ClientAliveInterval 0 #ClientAliveCountMax 3   Also, is there a command to dump a list of the current sshd settings?  I don't see anything in man sshd.