2015-10-20 77 views
2

Android的工作室已經更新,一切都準備好,但現在有了這個更新之前,我似乎無法讓我的下一個活動後,登錄成功啓動,在這裏:隨着更新到Android Studio無法啓動活動

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? 

什麼已經發生了??任何幫助?

+2

是一個活動Menu類? – albertoiNET

+2

用包名稱發佈您的菜單活動。 –

+1

停止在框架中的類命名您的類,你會沒事的。 '.Menu'被意外解析爲'com.parse.starter.' +'android.view.Menu'。 –

回答

2

試試這個清單

<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="com.parse.starter.Menu" 
     android:label="@string/title_activity_menu" 
     android:parentActivityName="com.parse.starter.MainActivity" 
     android:theme="@style/AppTheme" > 
     <meta-data 
      android:name="android.support.PARENT_ACTIVITY" 
      android:value="com.parse.starter.MainActivity" /> 
    </activity> 
</application> 
相關問題