title: Android FATAL EXCEPTION MAIN: java.lang.RuntimeException: Unable to start activity ComponentInfo
body: <p>This is my first project in Android, that means that I am newbie at programming it. I know here on forum is a lot of pages describing solution for my problem, but now I lost 2 days in still don't get the solution. Please help me!</p>
  <p>First of all my errors:</p>
  <pre><code>01-02 11:08:27.314: D/AndroidRuntime(1045): Shutting down VM
  01-02 11:08:27.314: W/dalvikvm(1045): threadid=1: thread exiting with uncaught exception (group=0x409e61f8)
  01-02 11:08:27.324: E/AndroidRuntime(1045): FATAL EXCEPTION: main
  01-02 11:08:27.324: E/AndroidRuntime(1045): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.wifiscan/com.example.wifiscan.activity_wifi_scan}: java.lang.ClassNotFoundException: com.example.wifiscan.activity_wifi_scan
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at android.os.Handler.dispatchMessage(Handler.java:99)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at android.os.Looper.loop(Looper.java:137)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at android.app.ActivityThread.main(ActivityThread.java:4424)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at java.lang.reflect.Method.invokeNative(Native Method)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at java.lang.reflect.Method.invoke(Method.java:511)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at dalvik.system.NativeStart.main(Native Method)
  01-02 11:08:27.324: E/AndroidRuntime(1045): Caused by: java.lang.ClassNotFoundException: com.example.wifiscan.activity_wifi_scan
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
  01-02 11:08:27.324: E/AndroidRuntime(1045):     ... 11 more
  </code></pre>
  <p>My WifiScan:</p>
  <pre><code> public class WifiScan extends Activity implements OnClickListener {      
       WifiManager wifi;       
       ListView lv;
       TextView textStatus;
       Button buttonScan;
       int size = 0;
       List&lt;ScanResult&gt; results;
   
       String ITEM_KEY = &quot;key&quot;;
       ArrayList&lt;HashMap&lt;String, String&gt;&gt; arraylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
       SimpleAdapter adapter;
   
       /* Called when the activity is first created. */
       @Override
       public void onCreate(Bundle savedInstanceState) 
       {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_wifi_scan);
   
           buttonScan = (Button) findViewById(R.id.scan);
           buttonScan.setOnClickListener(this);
           lv = (ListView)findViewById(R.id.list);
   
           wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
           if (wifi.isWifiEnabled() == false)
           {
               Toast.makeText(getApplicationContext(), &quot;wifi is disabled..making it enabled&quot;, Toast.LENGTH_LONG).show();
               wifi.setWifiEnabled(true);
           }   
           wifi.startScan(); //js dopisal
        //   this.adapter = new SimpleAdapter(WiFiDemo.this, arraylist, R.layout.row, new String[] { ITEM_KEY }, new int[] { R.id.list_value });
           lv.setAdapter(this.adapter);
   
                registerReceiver(new BroadcastReceiver()
           {
               @Override
               public void onReceive(Context c, Intent intent) 
               {
                  results = wifi.getScanResults();
                  size = results.size();
               }
           }, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));                    
       }
   
       public void onClick(View view) 
       {
           arraylist.clear();          
           wifi.startScan();
   
                Toast.makeText(this, &quot;Scanning....&quot; + size, Toast.LENGTH_SHORT).show();
           try 
           {
               size = size - 1;
               while (size &gt;= 0) 
               {   
                   HashMap&lt;String, String&gt; item = new HashMap&lt;String, String&gt;();                       
                   item.put(ITEM_KEY, results.get(size).SSID + &quot;  &quot; + results.get(size).capabilities);
   
                   arraylist.add(item);     
                  size--;
                   adapter.notifyDataSetChanged();                 
               } 
           }
           catch (Exception e)
           { }         
       }    
   }
  </code></pre>
  <p>My activity_wifi_scan.xml file:</p>
  <pre><code>&lt;TableLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
          android:id=&quot;@+id/TableLayout1&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:paddingBottom=&quot;@dimen/activity_vertical_margin&quot;
          android:paddingLeft=&quot;@dimen/activity_horizontal_margin&quot;
          android:paddingRight=&quot;@dimen/activity_horizontal_margin&quot;
          android:paddingTop=&quot;@dimen/activity_vertical_margin&quot;
          tools:context=&quot;.WifiScan&quot; &gt;
  
      &lt;Button    
          android:id=&quot;@+id/scan&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:onClick=&quot;scan&quot;
          android:text=&quot;SCAN&quot; /&gt;
  
      &lt;ListView
          android:id=&quot;@+id/list&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot; &gt;
      &lt;/ListView&gt;
  
  &lt;/TableLayout&gt;
  </code></pre>
  <p>And my AndroidManifest file:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
        &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
       package=&quot;com.example.wifiscan&quot;
       android:versionCode=&quot;1&quot;
            android:versionName=&quot;1.0&quot; &gt;
      
          &lt;uses-premission android:name=&quot;android.permission.ACCESS_WIFI_STATE&quot;/&gt;
           &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot;/&gt;
          &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;
       &lt;uses-permission android:name=&quot;android.permission.CHANGE_WIFI_STATE&quot;/&gt;
       &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot;/&gt;
       &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;&gt;&lt;/uses-permission&gt;
       &lt;uses-permission android:name=&quot;android.permission.CHANGE_WIFI_STATE&quot;&gt;&lt;/uses-permission&gt;
       &lt;uses-permission android:name=&quot;android.permission.READ_PHONE_STATE&quot;&gt; &lt;/uses-permission&gt;
       &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;&gt; &lt;/uses-permission&gt;
  
       &lt;uses-sdk
            android:minSdkVersion=&quot;8&quot;
           android:targetSdkVersion=&quot;17&quot; /&gt;
       
       &lt;application
           android:allowBackup=&quot;true&quot;
           android:icon=&quot;@drawable/ic_launcher&quot;
           android:label=&quot;@string/app_name&quot;
           android:theme=&quot;@style/AppTheme&quot; &gt;
       
       &lt;activity android:name=&quot;.activity_wifi_scan&quot;&gt;
           &lt;intent-filter&gt;
                   &lt;action android:name=&quot;android.intent.action.MAIN&quot;&gt;&lt;/action&gt;
                   &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;&gt;&lt;/category&gt;
                   &lt;data /&gt;
           &lt;/intent-filter&gt;
       &lt;/activity&gt;
       
       &lt;receiver android:name=&quot;.activity_wifi_scan&quot;&gt;
           &lt;intent-filter&gt;
               &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
               &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;/&gt;
              &lt;action android:name=&quot;android.net.wifi.WIFI_STATE_CHANGED&quot;/&gt;
           &lt;/intent-filter&gt;
       &lt;/receiver&gt;        
       &lt;/application&gt;
   &lt;/manifest&gt;
  </code></pre>