我收到錯誤「無法啓動活動ComponentInfo」。StartActivitity上的崩潰()Android Apps
當我打電話start_salud功能:
public void start_salud(View view) {
Intent intent = new Intent(MainActivity.this, salud.class);
startActivity(intent);
}
它崩潰的startActivity(intent)
我把它從android:onClick="start_salud"
。
salud_class:
package com.alertavecino.alertavecino;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;
import java.util.ArrayList;
public class salud extends AppCompatActivity {
ArrayList<String> listDiseases;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.salud_layout);
}
}
配音結果:
if (mResolvedMethod == null) { // <-- This statment is true
resolveMethod(mHostView.getContext(), mMethodName);
}
try {
mResolvedMethod.invoke(mResolvedContext, v); // <-- Here it's crashes
} catch (IllegalAccessException e) {
throw new IllegalStateException(
"Could not execute non-public method for android:onClick", e);
} catch (InvocationTargetException e) {
throw new IllegalStateException(
"Could not execute method for android:onClick", e);
}
的Manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.alertavecino.alertavecino">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="Alerta Vecino!"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
貓日誌:
11-25 20:17:31.924 29226-29226/com.alertavecino.alertavecino E /合子:MountEmulatedStorage() 11-25 20:17:31.924 29226-29226/com.alertavecino .alertavecino E /合子:V2 11-25 20:17:31.944 29226-29226/com.alertavecino.alertavecino E/SELinux的:[DEBUG] get_category:可變seinfo:默認靈敏度:NULL,cateogry:NULL
發佈崩潰日誌請 – Jon
發佈您的LogCat –
你可以發佈你的清單嗎?疑似。 –