title: Android Studio unable to find explicit activity class
body: <p>i have a application that allows me to alter/add/delete from mysql database. The application opens up fine when i run it but when i try clicking on the 'ViewAllEmployee' button i keep getting a error saying it cannot find explicit activity class. I have looked online and tried all solutions that have worked for people with this problem before. I have added it into my AndroidManifest too but it still doesn't want to work. Can anyone help? Literally been trying to fix this for hours!</p>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.assignment.androidassignment"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
  &lt;uses-sdk
  android:minSdkVersion="18"
  android:targetSdkVersion="21" /&gt;
  
  &lt;application
  android:allowBackup="true"
  android:label="@string/app_name" &gt;
  &lt;activity
      android:name="com.example.assignment.androidassignment.MainActivity"
      android:label="@string/app_name"
      android:theme="@android:style/Theme.Holo.Dialog" &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
              android:name="com.example.assignment.androidassignment.ViewAllEmployee"
          /&gt;
  &lt;/activity&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>MainActivity.java -- Error showing when onClick for 'ViewAllEmployee' is clicked:</p>
  
  <pre><code>package com.example.assignment.androidassignment;
  
  import android.app.Activity;
  import android.app.ProgressDialog;
  import android.content.Intent;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.Toast;
  import java.util.HashMap;
  
  public class MainActivity extends Activity implements View.OnClickListener{
  
  //Defining views
  private EditText editTextLatitude;
  private EditText editTextLongitude;
  private EditText editTextTimeInserted;
  
  private Button buttonAdd;
  private Button buttonView;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      //Initializing views
      editTextLatitude = (EditText) findViewById(R.id.editTextLat);
      editTextLongitude = (EditText) findViewById(R.id.editTextLon);
      editTextTimeInserted = (EditText) findViewById(R.id.editTextTimeInserted);
  
      buttonAdd = (Button) findViewById(R.id.buttonAdd);
      buttonView = (Button) findViewById(R.id.buttonView);
  
      //Setting listeners to button
      buttonAdd.setOnClickListener(this);
      buttonView.setOnClickListener(this);
     }
  
  
    //Adding an employee
    private void addEmployee(){
  
      final String lat = editTextLatitude.getText().toString().trim();
      final String lon = editTextLongitude.getText().toString().trim();
      final String timeInserted = editTextTimeInserted.getText().toString().trim();
  
      class AddEmployee extends AsyncTask&lt;Void,Void,String&gt;{
  
          ProgressDialog loading;
  
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
              loading = ProgressDialog.show(MainActivity.this,"Adding...","Wait...",false,false);
          }
  
          @Override
          protected void onPostExecute(String s) {
              super.onPostExecute(s);
              loading.dismiss();
              Toast.makeText(MainActivity.this,s,Toast.LENGTH_LONG).show();
          }
  
          @Override
          protected String doInBackground(Void... v) {
              HashMap&lt;String,String&gt; params = new HashMap&lt;&gt;();
              params.put(Config.KEY_LAT,lat);
              params.put(Config.KEY_LON,lon);
              params.put(Config.KEY_TIMEINSERTED,timeInserted);
  
              RequestHandler rh = new RequestHandler();
              String res = rh.sendPostRequest(Config.URL_ADD, params);
              return res;
          }
      }
  
      AddEmployee ae = new AddEmployee();
      ae.execute();
       }
  
     @Override
     public void onClick(View v) {
      if(v == buttonAdd){
          addEmployee();
      }
  
      if(v == buttonView){
          startActivity(new Intent(this,com.example.assignment.androidassignment.ViewAllEmployee.class));
      }
    }
   }
  </code></pre>
  
  <p>LogCat errors:</p>
  
  <pre><code>12-09 03:34:46.634 2489-2489/? E/AndroidRuntime: FATAL EXCEPTION: main
   =Process: com.example.assignment.androidassignment, PID: 2489
   android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.assignment.androidassignment/com.example.assignment.androidassignment.ViewAllEmployee}; have you declared this activity in your AndroidManifest.xml?
   at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1628)
   at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
   at android.app.Activity.startActivityForResult(Activity.java:3424)
   at android.app.Activity.startActivityForResult(Activity.java:3385)
   at android.app.Activity.startActivity(Activity.java:3627)
   at android.app.Activity.startActivity(Activity.java:3595)
   at com.example.assignment.androidassignment.MainActivity.onClick(MainActivity.java:91)
   at android.view.View.performClick(View.java:4438)
   at android.view.View$PerformClick.run(View.java:18422)
   at android.os.Handler.handleCallback(Handler.java:733)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:136)
   at android.app.ActivityThread.main(ActivityThread.java:5001)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:515)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
   at dalvik.system.NativeStart.main(Native Method)
  </code></pre>