I have an ExpandableListView in my Fragment that shows some data. I call the Fragment when i press an icon.   public void searchClick(){         Fragment frag = new Results();          FragmentTransaction ft  = getSupportFragmentManager().beginTransaction();          ft.replace(R.id.FragFaecher,frag).commit();            displayList();       }   displayList() then should populate the List and show it  public void displayList(){         populateList();          expList = (ExpandableListView) findViewById(R.id.expList);         listAdapter = new ExpListAdapter(MainActivity.this,parentList);         expList.setAdapter(listAdapter);      }   In FragmentClass the Layout with the ExpandableListView is inflated within the fragment_results Layout  public View onCreateView(LayoutInflater inflater, ViewGroup container,                              Bundle savedInstanceState) {        View rootView = inflater.inflate(R.layout.fragment_results, container, false);           return rootView;     }    fragment layout:    &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"         android:layout_width="match_parent" android:layout_height="match_parent"         android:id="@+id/results"         android:paddingBottom="@dimen/activity_vertical_margin"         android:paddingLeft="@dimen/activity_horizontal_margin"         android:paddingRight="@dimen/activity_horizontal_margin"         android:paddingTop="@dimen/activity_vertical_margin"         android:background="?android:colorBackground"         android:clickable="true"&gt;          &lt;ExpandableListView             android:layout_width="wrap_content"             android:layout_height="match_parent"             android:background="?android:colorBackground"             android:childDivider="#000000"             android:id="@+id/expList" /&gt;       &lt;/RelativeLayout&gt;   I suppose the problem is, that the displayList() method tries to find a View that is not yet created. I tried to return a boolean when the View was created, but that did not work. Is there any other possible way to prevent this from happening?
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?
Get the name of an object's type Can I define keyboard shortcuts using the Super key? When you are viewing an app in Google Play store, it displays the following : Updated, Size, Installs, Current Version, Requires Android, and Rating.  I am trying to do some research and figure out the initial release / publish dates of different apps. Is there a way to get this information from Google Play, or perhaps a website with this information? What is the best way to clone/deep copy a .NET generic Dictionary? No indent in the first paragraph in a section? I am just curious that the following format looks good to you or not? The preamble I used is just   \documentclass[12pt,a4paper]{article}  \usepackage{amsmath} \usepackage{amsthm} \usepackage{amssymb}   I don't feel it's so good because the first paragraph has no indent but the second does. If the first paragraph is much longer, than it's fine. But if not, it looks strange. Should I leave it, or you have suggestions for this? My professor sometimes asks me to referee papers for him.  Should I list the corresponding journals in the professionals activity section of my CV? I am trying to prove this inequality  $$|e^z-1|\leq e^{|z|}-1\leq |z|e^{|z|}$$  I've tried calculating the difference in their power series   $$\sum_{k=0}^\infty\frac{|z|^k}{k!}-1-\left|\,\sum_{k=0}^\infty\frac{z^k}{k!}-1\,\right|$$   but did not get anywhere. Duplicate:    I want an pseudo random number generator that can generate numbers with no repeats in a random order. For example: random(10) might return 5, 9, 1, 4, 2, 8, 3, 7, 6, 10 Is there a better way to do it other than making the range of numbers and shuffling them about, or checking the generated list for repeats?  Edit: Also I want it to be efficient in generating big numbers without the entire range.  Edit: I see everyone suggesting shuffle algorithms. But if I want to generate large random number (1024 byte+) then that method would take alot more memory than if I just used a regular RNG and inserted into a Set until it was a specified length, right? Is there no better mathematical algorithm for this. Could we please be a bit nicer to new users? Travelling on Business visa to UK for tourism purposes How to add/subtract months from given date in Excel I've often wondered why Stack Exchange has opted to keep the upvote/downvote buttons available for clicking on question/answers posted by the user. For instance:    Even though these buttons have no use for the user, why are they still placed on the post's left hand column? Moreover, the comments have no controls for flagging/+1'ing the user's own comment. What is the reason for this discrepancy? What benefit do the +1/-1 buttons provide to the user, even though they can't be used for anything? So I came across this exercise: Show that if $Y$ is path-connected then the set of homotopy classes $[I,Y]$ of maps of $I=[0,1]$ into Y has a single point.   But I am confused here. If $Y=S^1$ then not all loops are homotopic! I mean, isn't true that $\pi_1(Y)\subset [I,Y]$? Or maybe I don't understand the set $[I,Y]$ well! $G$ simple group and there exists a subgroup of index $n$. Show that: $|G|$ divides $n!/2$ Let $G$ be a simple group and there exists a subgroup $H$ of index $n \in \mathbb{N}_{\ge 3}$. Show that: $|G|$ divides $n!/2.$ I saw a similar question .   There was written: "The proof is really simple. Let $X$ be the set of left cosets of $H$. Consider $\phi: G \to \text{Sym}(X)$ given by $\phi(x)(aH)=(xa)H$. Then $\phi$ is a homomorphism. Consider now $K=\ker \phi$. Then $K$ is a normal subgroup of $G$ contained in $H$. Finally, $G/K$ is isomorphic to a subgroup of $\text{Sym}(X)$, which has order $n!$, where $n=[G:H]$. Thus, $[G:K]$ is finite and divides $n!$."  In fact, I don't understand the last sentence. "Thus, $[G:K]$ is finite and divides $n!$." Also did I understand it right that $ker(\phi)=H$?  Can you also give me an advice how to proof it for $n \ge 3$. (maybe induction)  Thank you for taking your time. Analysis Question Involving Real Numbers I'm stuck in full screen in the node editor. Escape isn't working, and I have no menus and no idea how to leave except to quit Blender and reopen the program. Why do we use von Neumann ordinals and not Zermelo ordinals? Why do we use von Neumann ordinals, $$ 0 = \emptyset $$ $$ n+1 = n \cup \{n\} $$  and not Zermelo ordinals? $$ 0 = \emptyset $$ $$ n+1 = \{ n \} $$ I thought that the quotation mark (") was simply a type of grouping marker but I'm debugging some NHibernate code and notice that while  SELECT * FROM site WHERE site_id = 3;   Works fine  SELECT * FROM "site" WHERE site_id = 3;   fails with a table or view does not exist error.  What gives? Which singular names ending in “s” form possessives with only a bare apostrophe? What is the difference between ++i and i++?