電話の起動時にAndroidアクティビティを表示したいのですが、アプリがクラッシュし、ログも取得できません。これがコードマニフェストです
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<receiver android:enabled="true" android:name=".BootUpReceiver"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity
android:label="@string/app_name"
android:name=".StartupActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
BOOTUPRECEIVER.JAVA
package com.example.sample;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class BootUpReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
Intent i = new Intent(context, StartupActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
STARTUPACTIVITY.JAVA
package com.example.sample;
import android.app.Activity;
import android.os.Bundle;
import com.android.R;
public class StartupActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
誰かが問題を手伝ってくれませんか
編集:03-20 16:05:24.519:E / AndroidRuntime(2709):java.lang.RuntimeException:アクティビティをインスタンス化できませんComponentInfo {com.android/com.android.StartupActivity}:java.lang.ClassNotFoundException:com.androidローダー内の.StartupActivitydalvik.system.PathClassLoader[/data/app/com.android-1.apk] 03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.ActivityThread.performLaunchActivity(ActivityThread。 java:1573)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)03-20 16:05:24.519:E / AndroidRuntime(2709) :android.app.ActivityThread.access $ 1500(ActivityThread.java:117)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.ActivityThread $ H.handleMessage(ActivityThread.java:935) 03-20 16:05:24.519:E / AndroidRuntime(2709):android.os.Handlerで。dispatchMessage(Handler.java:99)03-20 16:05:24.519:E / AndroidRuntime(2709):at android.os.Looper.loop(Looper.java:130)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.ActivityThread.main(ActivityThread.java:3687)03-20 16:05:24.519:E / AndroidRuntime(2709):java.lang.reflect.Method.invokeNative(ネイティブメソッド) 03-20 16:05:24.519:E / AndroidRuntime(2709):at java.lang.reflect.Method.invoke(Method.java:507)03-20 16:05:24.519:E / AndroidRuntime(2709):at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:842)03-20 16:05:24.519:E / AndroidRuntime(2709):com.android.internal.os.ZygoteInit.main(ZygoteInit .java:600)03-20 16:05:24.519:E / AndroidRuntime(2709):dalvik.system.NativeStart.main(ネイティブメソッド)03-20 16:05:24.519:E / AndroidRuntime(2709):原因作成者:java.lang。ClassNotFoundException:ローダー内のcom.android.StartupActivity dalvik.system.PathClassLoader [/data/app/com.android-1.apk] 03-20 16:05:24.519:E / AndroidRuntime(2709):dalvik.system.PathClassLoaderで.findClass(PathClassLoader.java:240)03-20 16:05:24.519:E / AndroidRuntime(2709):at java.lang.ClassLoader.loadClass(ClassLoader.java:551)03-20 16:05:24.519:E /AndroidRuntime(2709):at java.lang.ClassLoader.loadClass(ClassLoader.java:511)03-20 16:05:24.519:E / AndroidRuntime(2709):at android.app.Instrumentation.newActivity(Instrumentation.java: 1021)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)03-20 16:05:24.519:E / AndroidRuntime(2709):。 ..11以上apk] 03-20 16:05:24.519:E / AndroidRuntime(2709):dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)03-20 16:05:24.519:E / AndroidRuntime(2709):at java.lang.ClassLoader.loadClass(ClassLoader.java:551)03-20 16:05:24.519:E / AndroidRuntime(2709):java.lang.ClassLoader.loadClass(ClassLoader.java:511)03-20 16: 05:24.519:E / AndroidRuntime(2709):android.app.Instrumentation.newActivity(Instrumentation.java:1021)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.ActivityThread.performLaunchActivity (ActivityThread.java:1565)03-20 16:05:24.519:E / AndroidRuntime(2709):... 11 moreapk] 03-20 16:05:24.519:E / AndroidRuntime(2709):dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)03-20 16:05:24.519:E / AndroidRuntime(2709):at java.lang.ClassLoader.loadClass(ClassLoader.java:551)03-20 16:05:24.519:E / AndroidRuntime(2709):java.lang.ClassLoader.loadClass(ClassLoader.java:511)03-20 16: 05:24.519:E / AndroidRuntime(2709):android.app.Instrumentation.newActivity(Instrumentation.java:1021)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.ActivityThread.performLaunchActivity (ActivityThread.java:1565)03-20 16:05:24.519:E / AndroidRuntime(2709):... 11 more05:24.519:E / AndroidRuntime(2709):java.lang.ClassLoader.loadClass(ClassLoader.java:511)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.Instrumentation.newActivity (Instrumentation.java:1021)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)03-20 16:05:24.519:E / AndroidRuntime (2709):...11詳細05:24.519:E / AndroidRuntime(2709):java.lang.ClassLoader.loadClass(ClassLoader.java:511)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.Instrumentation.newActivity (Instrumentation.java:1021)03-20 16:05:24.519:E / AndroidRuntime(2709):android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)03-20 16:05:24.519:E / AndroidRuntime (2709):...11詳細