【发布时间】:2015-10-20 15:35:33
【问题描述】:
Android 工作室已经更新,在一切正常之前,但现在有了这个更新,我似乎无法在成功登录后开始下一个活动,这里:
public void doLogIn(View v) {
EditText username = (EditText) findViewById(R.id.userEditText);
EditText password = (EditText) findViewById(R.id.passwordditText);
final Intent intent = new Intent(this, Menu.class);
if (username.getText().toString().isEmpty() || password.getText().toString().isEmpty()) {
//Intent intent = new Intent(this, Registro_activity.class);
//intent.putExtra(EXTRA_MESSAGE, change);
Toast.makeText(this, "Necesitas poner tu usuario y la contraseña para acceder.", Toast.LENGTH_LONG).show();
} else {
Log.d("We", "are almost");
ParseUser.logInInBackground(username.getText().toString(), password.getText().toString(), new LogInCallback() {
@Override
public void done(ParseUser user, com.parse.ParseException e) {
if (user != null) {
// Hooray! The user is logged in.
Log.d("IN", "APP");
validLogin(e);
startActivityNew(intent);
} else {
// Signup failed. Look at the ParseException to see what happened.
Log.d("error", e.toString());
invalidLogin(e);
}
}
});
}
}
public void startActivityNew(Intent intent) {
startActivity(intent);
}
并且在AndroidManifest.xml中声明为:
<application
android:name=".StarterApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.parse.APPLICATION_ID"
android:value="@string/parse_app_id" />
<meta-data
android:name="com.parse.CLIENT_KEY"
android:value="@string/parse_client_key" />
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ChangePass"
android:label="@string/title_activity_change_pass" >
</activity>
<activity
android:name=".Menu"
android:label="@string/title_activity_menu"
android:parentActivityName=".MainActivity"
android:theme="@style/AppTheme" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.parse.starter.MainActivity" />
</activity>
</application>
错误:
10-19 23:44:58.922 21649-21649/com.parse.starter E/AndroidRuntime: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.parse.starter/android.view.Menu}; have you declared this activity in your AndroidManifest.xml?
发生了什么事??有什么帮助吗??
【问题讨论】:
-
Activity 是 Menu 类吗?
-
使用包名称发布您的菜单活动。
-
停止在框架中的类之后命名你的类,你会没事的。
.Menu被意外解析为com.parse.starter.+android.view.Menu。
标签: android android-activity android-studio