Unable to instantiate activity in android
<p>when i am running my project it will show the following message on log cat please help me. i have cleaned project many times. and i am using rest Templates.</p>

<pre><code>06-06 14:08:42.251: ERROR/AndroidRuntime(432): FATAL EXCEPTION: main
06-06 14:08:42.251: ERROR/AndroidRuntime(432): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.shopzilla.android.common/org.shopzilla.android.common.MainActivity}: java.lang.ClassNotFoundException: org.shopzilla.android.common.MainActivity in loader dalvik.system.PathClassLoader[/data/app/org.shopzilla.android.common-2.apk]
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at android.os.Looper.loop(Looper.java:123)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at android.app.ActivityThread.main(ActivityThread.java:3683)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at java.lang.reflect.Method.invokeNative(Native Method)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at java.lang.reflect.Method.invoke(Method.java:507)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at dalvik.system.NativeStart.main(Native Method)
06-06 14:08:42.251: ERROR/AndroidRuntime(432): Caused by: java.lang.ClassNotFoundException: org.shopzilla.android.common.MainActivity in loader dalvik.system.PathClassLoader[/data/app/org.shopzilla.android.common-2.apk]
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-06 14:08:42.251: ERROR/AndroidRuntime(432):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
</code></pre>

<p>*<em>Manifest File is *</em></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.shopzilla.android.common"
      android:versionCode="1"
      android:versionName="1.0"&gt;


    &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
        &lt;activity android:name=".MainActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"
                  android:label="@string/app_name"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
 &lt;activity android:name="org.shopzilla.android.search.SearchTabActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
 &lt;activity android:name="org.shopzilla.android.Barcode.BarcodeTabActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
 &lt;activity android:name="org.shopzilla.android.favorites.MyFavoritesTabActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
 &lt;activity android:name="org.shopzilla.android.search.SearchResultActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
 &lt;activity android:name="org.shopzilla.android.search.SearchSuggestionActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
  &lt;activity android:name="org.shopzilla.android.search.SearchGridActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
  &lt;activity android:name="org.shopzilla.android.search.SearchRefine" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
   &lt;activity android:name="org.shopzilla.android.product.ProductComparisonActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
   &lt;activity android:name="org.shopzilla.android.product.ProductDetailActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
   &lt;activity android:name="org.shopzilla.android.product.ProductShareActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
   &lt;activity android:name="org.shopzilla.android.product.ProductZoomActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
   &lt;activity android:name="org.shopzilla.android.moretab.SettingActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
   &lt;activity android:name="org.shopzilla.android.moretab.AboutActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
   &lt;activity android:name="org.shopzilla.android.moretab.PrivacyPolicyActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
   &lt;activity android:name="org.shopzilla.android.favorites.MyfavoritesTabActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
   &lt;activity android:name="org.shopzilla.android.facebook.FacebookActivity" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;
    &lt;activity android:name="org.shopzilla.android.moretab.More" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:screenOrientation="portrait"&gt;&lt;/activity&gt;


    &lt;activity android:name="com.google.zxing.client.android.CaptureActivity"
              android:screenOrientation="landscape"
              android:configChanges="orientation|keyboardHidden"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:windowSoftInputMode="stateAlwaysHidden"&gt;
      &lt;intent-filter&gt;
       &lt;action android:name="android.intent.action.VIEW"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
        &lt;category android:name="android.intent.category.BROWSABLE"/&gt;
      &lt;/intent-filter&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="com.google.zxing.client.android.SCAN"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
      &lt;/intent-filter&gt;
      &lt;!-- Allow web apps to launch Barcode Scanner by linking to http://zxing.appspot.com/scan. --&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.VIEW"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
        &lt;category android:name="android.intent.category.BROWSABLE"/&gt;
        &lt;data android:scheme="http" android:host="zxing.appspot.com" android:path="/scan"/&gt;
      &lt;/intent-filter&gt;
      &lt;!-- We also support a Google Product Search URL. --&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.VIEW"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
        &lt;category android:name="android.intent.category.BROWSABLE"/&gt;
        &lt;data android:scheme="http" android:host="www.google.com" android:path="/m/products/scan"/&gt;
      &lt;/intent-filter&gt;
      &lt;!-- And the UK version. --&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.VIEW"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
        &lt;category android:name="android.intent.category.BROWSABLE"/&gt;
        &lt;data android:scheme="http" android:host="www.google.co.uk" android:path="/m/products/scan"/&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;activity android:name="com.google.zxing.client.android.PreferencesActivity"
              android:label="@string/preferences_name"&gt;
    &lt;/activity&gt;
    &lt;activity android:name="com.google.zxing.client.android.encode.EncodeActivity"&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="com.google.zxing.client.android.ENCODE"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
      &lt;/intent-filter&gt;
      &lt;!-- This allows us to handle the Share button in Contacts. --&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.SEND"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
        &lt;data android:mimeType="text/x-vcard"/&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;activity android:name="com.google.zxing.client.android.book.SearchBookContentsActivity"
              android:label="@string/sbc_name"
              android:screenOrientation="landscape"
              android:configChanges="orientation|keyboardHidden"&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="com.google.zxing.client.android.SEARCH_BOOK_CONTENTS"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;activity android:name="com.google.zxing.client.android.wifi.WifiActivity"
              android:label="@string/wa_name"
              android:screenOrientation="landscape"
              android:configChanges="orientation|keyboardHidden"&gt;
    &lt;/activity&gt;
    &lt;activity android:name="com.google.zxing.client.android.share.ShareActivity"
              android:label="@string/share_name"
              android:screenOrientation="user"&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="com.google.zxing.client.android.SHARE"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;activity android:name="com.google.zxing.client.android.share.BookmarkPickerActivity"
              android:label="@string/bookmark_picker_name"&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.PICK"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;activity android:name="com.google.zxing.client.android.share.AppPickerActivity"
              android:label="@string/app_picker_name"&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.PICK"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;activity android:name="com.google.zxing.client.android.HelpActivity"
              android:screenOrientation="user"&gt;
      &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.VIEW"/&gt;
        &lt;category android:name="android.intent.category.DEFAULT"/&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
    &lt;/application&gt;
     &lt;uses-permission android:name="android.permission.CAMERA"/&gt;
  &lt;uses-permission android:name="android.permission.READ_CONTACTS"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_CONTACTS"/&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/&gt;
  &lt;uses-permission android:name="android.permission.VIBRATE"/&gt;
  &lt;uses-permission android:name="android.permission.FLASHLIGHT"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;

  &lt;!-- Wifi related  --&gt;
  &lt;uses-permission android:name="android.permission.WRITE_SETTINGS" /&gt;
  &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"&gt;&lt;/uses-permission&gt;
&lt;/manifest&gt;
</code></pre>

<p>On Create code is</p>

<pre><code>    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Button btn = (Button)findViewById(R.id.btn_Search);
    Button btn_scanbar = (Button)findViewById(R.id.btn_ScanBar);
    txt_search = (TextView)findViewById(R.id.txt_Search);

   recent.add(txt_search.getText().toString());
  keyword=  txt_search.getText().toString();
   //Open Search Result Activity
  showDialog(0);
    btn.setOnClickListener(new View.OnClickListener() {

        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            Intent intent = new Intent(MainActivity.this,SearchResultActivity.class);
            intent.putExtra("keyword",txt_search.getText().toString());
            startActivity(intent);

        }
    });
    //Open Scan BarCode Activity
    btn_scanbar.setOnClickListener(new View.OnClickListener() {


        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            Intent intent = new Intent(MainActivity.this,CaptureActivity.class);
            startActivity(intent);
        }
    });

    //Geo Coding

    this.locationManager = 
        (LocationManager) getSystemService(Context.LOCATION_SERVICE);

    // Subscribe to the location manager's updates on the current location
    this.locationManager.requestLocationUpdates("gps", (long)30000, (float) 10.0, new LocationListener()
        {
            public void onLocationChanged(Location arg0) 
            {
                handleLocationChanged(arg0);
            }

            public void onProviderDisabled(String arg0) {
                // TODO Auto-generated method stub

            }

            public void onProviderEnabled(String arg0) {
                // TODO Auto-generated method stub

            }

            public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
                // TODO Auto-generated method stub
            }
        });
</code></pre>
