i am getting this error when ever i try to click a button:
public class NncActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button b = (Button) findViewById(R.id.loginButton);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(NncActivity.this, Status.class));
}
});
}
}
i have added
<activity android:name=".Status"></activity>
to the Manifest exactly after the first </activity>
but i am still getting that error!
anyone has any idea why?
this is what the Logcat shows
> threadid=1: thread exiting with uncaught exception (group=0x40015560)
FATAL EXCEPTION: main
android.content.ActivityNotFoundException: Unable to find explicit activity class {nco.surt/android.net.wifi.WifiConfiguration$Status}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
at android.app.Activity.startActivityForResult(Activity.java:2827)
at android.app.Activity.startActivity(Activity.java:2933)
at nco.surt.NncActivity$1.onClick(NncActivity.java:23)
at android.view.View.performClick(View.java:2485)
at android.view.View$PerformClick.run(View.java:9080)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
please help.
Seems like the
Status.classyou are using in the intent refers toandroid.net.wifi.WifiConfiguration$Statusinstead of yourStatusActivity. Check your#imports to see you are not getting the wrong import, or use the qualified name forStatusin your intent.