i've been using this site to fix my problems with android/eclipse. But in this moment im very stuck i searched almost every thread regarding this problem but i cant found a solution.
Its simple i want to move from one activity to other after the validation succeed, using the android saripaar everything was going cool until i got a runtime error in the logcat, the error is
07-20 23:10:59.312: E/AndroidRuntime(2562): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.projectcandy/android.view.Menu}; have you declared this activity in your AndroidManifest.xml?
Please check this specially
{com.example.projectcandy/android.view.Menu}
com.example.projectcandy its my package and my class is Menu. But why the log cat show me that 'Android.view' ?
What I've done so far?
1) Insert the filter line in the manifest 2)Clean the project 3)Delete the activity from the manifest and add it again using the application nodes > Add etc.. 4)Change the way i make the intent. Really i dont know what to do know
Im posting my manifest,MainActivity.java and the "Menu.class" here
MANIFEST
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.projectcandy"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.projectcandy.MainActivity"
android:label="@string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Menu">
<intent-filter>
<action android:name="com.example.projectcandy.Menu" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
On create method from mainactivity.java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
validator = new Validator(this);
validator.setValidationListener(this);
usernamereg=(EditText)findViewById(R.id.usernamereg);
password=(EditText)findViewById(R.id.password);
Loginb=(Button)findViewById(R.id.Loginb);
Loginb.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
validator.validate();
}
});
The onValidationSucceeded Method (From android saripaar library)
@Override
public void onValidationSucceeded() {
// TODO Auto-generated method stub
Toast.makeText(this, "Iniciando sesion...", Toast.LENGTH_SHORT).show();
String user= usernamereg.getText().toString();
String psw= password.getText().toString();
if (user.equals("admin") && psw.equals("1234")){
Intent i = new Intent(this, Menu.class );
startActivity(i);
}
else {
Toast t= Toast.makeText(this,"Usuario o contraseña incorrectos", Toast.LENGTH_SHORT);
t.show();
}
}
Maybe im doing something wrong with the parameters of the on click class. Thanks everyone