title: How to restart an Android Activity?
body: <p>I am creating an application in Android,  but when I would like to update some data, I want to restart my MainActivity. But my problem when I try to restart my Application, it crashes. </p>
  
  <p>I use the following code to restart my Activity</p>
  
  <pre><code> case R.id.update:
          admin = false;
          Intent intent1 = getIntent();
           finish();
           startActivity(intent1);    
          break;
  </code></pre>
  
  <p>my Log is </p>
  
  <pre><code>04-22 12:28:10.444: E/AndroidRuntime(11867): FATAL EXCEPTION: main
  04-22 12:28:10.444: E/AndroidRuntime(11867): java.lang.RuntimeException: Unable to start activity ComponentInfo{package_____________/package________.LauncherGridActivity}: java.lang.NullPointerException
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.os.Handler.dispatchMessage(Handler.java:99)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.os.Looper.loop(Looper.java:137)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.app.ActivityThread.main(ActivityThread.java:4424)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at java.lang.reflect.Method.invokeNative(Native Method)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at java.lang.reflect.Method.invoke(Method.java:511)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at dalvik.system.NativeStart.main(Native Method)
  04-22 12:28:10.444: E/AndroidRuntime(11867): Caused by: java.lang.NullPointerException
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at com.___________.ApplicationManager.loadFilteredNames(ApplicationManager.java:228)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at com______.ApplicationManager.loadApplications(ApplicationManager.java:65)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at co___.LauncherGridActivity.onCreate(LauncherGridActivity.java:142)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.app.Activity.performCreate(Activity.java:4465)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  04-22 12:28:10.444: E/AndroidRuntime(11867):    ... 11 m
  </code></pre>