title: android.view.InflateException :Error Inflating Class
body: <p>I am trying to call new page from main activity. Main activity has <code>Button</code>, <code>onClick</code> of the button I am launching the new page as below </p>
  
  <pre><code>@Override
  public void onClick(View arg0) {
    if(arg0.getId() == R.id.buttonSearch){
          //define a new Intent for the second Activity
          Intent intent = new Intent(this,SearchActivity.class);
          //start the second Activity
          this.startActivity(intent);
      }
  }
  </code></pre>
  
  <p>while loading the new page i am getting an error at :       </p>
  
  <pre><code>this.setContentView(R.layout.searchm);
  </code></pre>
  
  <p>BELOW IS CODE OF LOADING PAGE </p>
  
  <pre><code>public class SearchActivity extends Activity   {
  
   Context context;    
   @Override
   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      this.setContentView(R.layout.searchm);
  </code></pre>
  
  <p>THE LOGCAT IS AS BELOW</p>
  
  <pre><code>    09-09 14:05:23.766: E/MapActivity(1163): Couldn't get connection factory client
      09-09 14:11:22.036: E/AndroidRuntime(1163): FATAL EXCEPTION: main
      09-09 14:11:22.036: E/AndroidRuntime(1163): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidhive.googlemaps/com.androidhive.googlemaps.SearchActivity}: java.lang.NullPointerException
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.os.Handler.dispatchMessage(Handler.java:99)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.os.Looper.loop(Looper.java:137)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.app.ActivityThread.main(ActivityThread.java:5103)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at java.lang.reflect.Method.invokeNative(Native Method)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at java.lang.reflect.Method.invoke(Method.java:525)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at dalvik.system.NativeStart.main(Native Method)
      09-09 14:11:22.036: E/AndroidRuntime(1163): Caused by: java.lang.NullPointerException
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at com.androidhive.googlemaps.SearchActivity.onCreate(SearchActivity.java:113)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.app.Activity.performCreate(Activity.java:5133)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
      09-09 14:11:22.036: E/AndroidRuntime(1163):     ... 11 more
      09-09 14:14:15.676: E/MapActivity(1226): Couldn't get connection factory client
      09-09 14:14:27.676: E/AndroidRuntime(1226): FATAL EXCEPTION: main
      09-09 14:14:27.676: E/AndroidRuntime(1226): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidhive.googlemaps/com.androidhive.googlemaps.SearchActivity}: java.lang.NullPointerException
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.os.Handler.dispatchMessage(Handler.java:99)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.os.Looper.loop(Looper.java:137)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.app.ActivityThread.main(ActivityThread.java:5103)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at java.lang.reflect.Method.invokeNative(Native Method)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at java.lang.reflect.Method.invoke(Method.java:525)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at dalvik.system.NativeStart.main(Native Method)
      09-09 14:14:27.676: E/AndroidRuntime(1226): Caused by: java.lang.NullPointerException
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at com.androidhive.googlemaps.SearchActivity.onCreate(SearchActivity.java:113)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.app.Activity.performCreate(Activity.java:5133)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
      09-09 14:14:27.676: E/AndroidRuntime(1226):     ... 11 more
      09-09 14:16:15.239: E/AndroidRuntime(1288): FATAL EXCEPTION: main
      09-09 14:16:15.239: E/AndroidRuntime(1288): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidhive.googlemaps/com.androidhive.googlemaps.AndroidGoogleMapsActivity}: java.lang.NullPointerException
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.os.Handler.dispatchMessage(Handler.java:99)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.os.Looper.loop(Looper.java:137)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.app.ActivityThread.main(ActivityThread.java:5103)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at java.lang.reflect.Method.invokeNative(Native Method)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at java.lang.reflect.Method.invoke(Method.java:525)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at dalvik.system.NativeStart.main(Native Method)
      09-09 14:16:15.239: E/AndroidRuntime(1288): Caused by: java.lang.NullPointerException
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at com.androidhive.googlemaps.AndroidGoogleMapsActivity.onCreate(AndroidGoogleMapsActivity.java:36)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.app.Activity.performCreate(Activity.java:5133)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
      09-09 14:16:15.239: E/AndroidRuntime(1288):     ... 11 more
      09-09 14:29:01.106: E/MapActivity(1344): Couldn't get connection factory client
      09-09 14:29:12.417: E/AndroidRuntime(1344): FATAL EXCEPTION: main
      09-09 14:29:12.417: E/AndroidRuntime(1344): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidhive.googlemaps/com.androidhive.googlemaps.SearchActivity}: android.view.InflateException: Binary XML file line #14: Error inflating class CustomAutoCompleteTextView
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.os.Handler.dispatchMessage(Handler.java:99)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.os.Looper.loop(Looper.java:137)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.app.ActivityThread.main(ActivityThread.java:5103)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at java.lang.reflect.Method.invokeNative(Native Method)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at java.lang.reflect.Method.invoke(Method.java:525)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at dalvik.system.NativeStart.main(Native Method)
      09-09 14:29:12.417: E/AndroidRuntime(1344): Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class CustomAutoCompleteTextView
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.app.Activity.setContentView(Activity.java:1895)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at com.androidhive.googlemaps.SearchActivity.onCreate(SearchActivity.java:27)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.app.Activity.performCreate(Activity.java:5133)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     ... 11 more
      09-09 14:29:12.417: E/AndroidRuntime(1344): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.CustomAutoCompleteTextView" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.androidhive.googlemaps-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.androidhive.googlemaps-1, /vendor/lib, /system/lib]]
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.view.LayoutInflater.createView(LayoutInflater.java:559)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:652)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
      09-09 14:29:12.417: E/AndroidRuntime(1344):     ... 21 mor
  
  e
  </code></pre>