开始新活动时强制关闭

时间:2011-08-19 02:10:33

标签: java android

所以,当我点击“Do Something useless Button”Android强制关闭我的应用程序。这是我的代码:

MainActivity.java:

public class MainActivity extends Activity {

    Button doUseless;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        doUseless = (Button)findViewById(R.id.bUselessTask);
        doUseless.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {

                Intent openUseless = new Intent("com.apps.epicad.USELESS");
                startActivity(openUseless);

        }
            });
        Context context = getApplicationContext();
        CharSequence text = "Andrew's App Has Started!";
        int duration = Toast.LENGTH_SHORT;

        Toast toast = Toast.makeText(context, text, duration);
        toast.show();
    }
}

的AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.apps.epicad.andrewapp"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="8" />

    <application android:label="@string/app_name" android:debuggable="false" android:icon="@drawable/eva">
        <activity android:name=".SplashActivity"
                  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=".MainActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="com.apps.epicad.ANDREWAPP" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
         <activity android:name=".UselessActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="com.apps.epicad.USELESS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

    </application>
</manifest>

UselessActivity.java:

public class UselessActivity extends Activity {

    Button doUseless;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        doUseless = (Button)findViewById(R.id.bDoUseless);
        doUseless.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                ProgressDialog dia = new ProgressDialog(UselessActivity.this);
                dia.show(getApplication(), "Doing Something", "Being Epic", true, true);

            }
        });
        Context context = getApplicationContext();
        CharSequence text = "Andrew's App Has Showed Do Something Useless Screen!";
        int duration = Toast.LENGTH_SHORT;

        Toast toast = Toast.makeText(context, text, duration);
        toast.show();


    }

}

logcat的:

08-18 19:08:06.550: DEBUG/ConnectivityService(1310): getMobileDataEnabled returning true
08-18 19:08:07.731: DEBUG/AndroidRuntime(2516): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
08-18 19:08:07.731: DEBUG/AndroidRuntime(2516): CheckJNI is OFF
08-18 19:08:07.731: DEBUG/dalvikvm(2516): creating instr width table
08-18 19:08:07.891: DEBUG/AndroidRuntime(2516): Calling main entry com.android.commands.pm.Pm
08-18 19:08:07.911: WARN/PackageManager(1310): grantUriPermission URI=file:///data/local/tmp/AndrewApp.apk
08-18 19:08:07.942: DEBUG/dalvikvm(2364): GC_EXPLICIT freed 4K, 50% free 2703K/5379K, external 0K/0K, paused 23ms
08-18 19:08:07.962: DEBUG/PackageParser(1310): Scanning package: /data/app/vmdl-1797381420.tmp
08-18 19:08:07.962: WARN/ActivityManager(1310): No content provider found for: 
08-18 19:08:08.022: INFO/PackageManager(1310): Removing non-system package:com.apps.epicad.andrewapp
08-18 19:08:08.022: INFO/ActivityManager(1310): Force stopping package com.apps.epicad.andrewapp uid=10161
08-18 19:08:08.182: DEBUG/lights(1310): set_light_buttons_func: on=5329233 brightness=81
08-18 19:08:08.182: DEBUG/lights(1310): set_light_buttons_func: on=16777215 brightness=255
08-18 19:08:08.272: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)
08-18 19:08:08.792: DEBUG/PackageManager(1310): Scanning package com.apps.epicad.andrewapp
08-18 19:08:08.792: DEBUG/installd(1220): DexInv: --- BEGIN '/data/app/com.apps.epicad.andrewapp-2.apk' ---
08-18 19:08:08.792: INFO/PackageManager(1310): Package com.apps.epicad.andrewapp codePath changed from /data/app/com.apps.epicad.andrewapp-1.apk to /data/app/com.apps.epicad.andrewapp-2.apk; Retaining data and using new
08-18 19:08:08.792: INFO/PackageManager(1310): Unpacking native libraries for /data/app/com.apps.epicad.andrewapp-2.apk
08-18 19:08:08.812: DEBUG/dalvikvm(2526): creating instr width table
08-18 19:08:08.832: DEBUG/dalvikvm(2526): DexOpt: load 4ms, verify+opt 13ms
08-18 19:08:08.832: DEBUG/StatusBarPolicy(1531): onSignalStrengthsChanged
08-18 19:08:08.842: DEBUG/StatusBarPolicy(1531): ATT SignalStrength:  asu=7 signalDbm=100 ecno=18
08-18 19:08:08.852: DEBUG/installd(1220): DexInv: --- END '/data/app/com.apps.epicad.andrewapp-2.apk' (success) ---
08-18 19:08:08.852: INFO/ActivityManager(1310): Force stopping package com.apps.epicad.andrewapp uid=10161
08-18 19:08:08.852: WARN/PackageManager(1310): Code path for pkg : com.apps.epicad.andrewapp changing from /data/app/com.apps.epicad.andrewapp-1.apk to /data/app/com.apps.epicad.andrewapp-2.apk
08-18 19:08:08.862: DEBUG/PackageManager(1310):   Activities: com.apps.epicad.andrewapp.SplashActivity com.apps.epicad.andrewapp.MainActivity
08-18 19:08:08.862: WARN/PackageManager(1310): Resource path for pkg : com.apps.epicad.andrewapp changing from /data/app/com.apps.epicad.andrewapp-1.apk to /data/app/com.apps.epicad.andrewapp-2.apk
08-18 19:08:09.063: INFO/installd(1220): move /data/dalvik-cache/data@app@com.apps.epicad.andrewapp-2.apk@classes.dex -> /data/dalvik-cache/data@app@com.apps.epicad.andrewapp-2.apk@classes.dex
08-18 19:08:09.063: DEBUG/PackageManager(1310): New package installed in /data/app/com.apps.epicad.andrewapp-2.apk
08-18 19:08:09.183: INFO/ActivityManager(1310): Force stopping package com.apps.epicad.andrewapp uid=10161
08-18 19:08:09.303: DEBUG/dalvikvm(1310): GC_EXPLICIT freed 1367K, 45% free 9985K/17863K, external 4504K/5618K, paused 114ms
08-18 19:08:09.353: DEBUG/dalvikvm(1547): GC_EXPLICIT freed 467K, 49% free 4679K/9031K, external 1301K/1813K, paused 154ms
08-18 19:08:09.393: DEBUG/PhoneApp(1544): -- PackageChangeBroadcastReceiver  action = android.intent.action.PACKAGE_REMOVED
08-18 19:08:09.723: DEBUG/szipinf(1310): Initializing inflate state
08-18 19:08:09.873: DEBUG/dalvikvm(1310): GC_EXPLICIT freed 258K, 44% free 10040K/17863K, external 4504K/5618K, paused 111ms
08-18 19:08:09.893: WARN/ResourceType(26733): getEntry failing because entryIndex 187 is beyond type entryCount 123
08-18 19:08:09.893: WARN/ResourceType(26733): Failure getting entry for 0x7f0200bb (t=1 e=187) in package 0 (error -2147483647)
08-18 19:08:09.913: WARN/ResourceType(26733): getEntry failing because entryIndex 187 is beyond type entryCount 123
08-18 19:08:09.913: WARN/ResourceType(26733): Failure getting entry for 0x7f0200bb (t=1 e=187) in package 0 (error -2147483647)
08-18 19:08:09.923: WARN/ResourceType(26733): getEntry failing because entryIndex 187 is beyond type entryCount 123
08-18 19:08:09.923: WARN/ResourceType(26733): Failure getting entry for 0x7f0200bb (t=1 e=187) in package 0 (error -2147483647)
08-18 19:08:09.973: DEBUG/dalvikvm(26733): GC_CONCURRENT freed 453K, 49% free 3148K/6151K, external 20K/532K, paused 2ms+8ms
08-18 19:08:09.994: WARN/ResourceType(26733): getEntry failing because entryIndex 187 is beyond type entryCount 123
08-18 19:08:09.994: WARN/ResourceType(26733): Failure getting entry for 0x7f0200bb (t=1 e=187) in package 0 (error -2147483647)
08-18 19:08:10.004: WARN/ResourceType(26733): getEntry failing because entryIndex 187 is beyond type entryCount 123
08-18 19:08:10.004: WARN/ResourceType(26733): Failure getting entry for 0x7f0200bb (t=1 e=187) in package 0 (error -2147483647)
08-18 19:08:10.014: WARN/ResourceType(26733): getEntry failing because entryIndex 187 is beyond type entryCount 123
08-18 19:08:10.014: WARN/ResourceType(26733): Failure getting entry for 0x7f0200bb (t=1 e=187) in package 0 (error -2147483647)
08-18 19:08:10.024: WARN/ResourceType(26733): getEntry failing because entryIndex 187 is beyond type entryCount 123
08-18 19:08:10.024: WARN/ResourceType(26733): Failure getting entry for 0x7f0200bb (t=1 e=187) in package 0 (error -2147483647)
08-18 19:08:10.024: WARN/ResourceType(26733): getEntry failing because entryIndex 187 is beyond type entryCount 123
08-18 19:08:10.024: WARN/ResourceType(26733): Failure getting entry for 0x7f0200bb (t=1 e=187) in package 0 (error -2147483647)
08-18 19:08:10.074: DEBUG/PhoneApp(1544): -- PackageChangeBroadcastReceiver  action = android.intent.action.PACKAGE_ADDED
08-18 19:08:10.104: INFO/installd(1220): unlink /data/dalvik-cache/data@app@com.apps.epicad.andrewapp-1.apk@classes.dex
08-18 19:08:10.114: DEBUG/HomeLoaders(2737): get install or remove message so do change adapter
08-18 19:08:10.114: DEBUG/HomeLoaders(2737): get install or remove message so do change adapter
08-18 19:08:10.174: DEBUG/ConnectivityService(1310): getMobileDataEnabled returning true
08-18 19:08:10.504: DEBUG/dalvikvm(2737): GC_EXTERNAL_ALLOC freed 857K, 44% free 5705K/10055K, external 23735K/23754K, paused 58ms
08-18 19:08:10.574: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)
08-18 19:08:10.604: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)
08-18 19:08:10.664: DEBUG/PowerManagerService(1310): New lightsensor value:10, lcdValue:81
08-18 19:08:10.664: DEBUG/PowerManagerService(1310): lightSensorChangedLocked, buttonValue >= 0, mPowerState = 3
08-18 19:08:10.674: DEBUG/AndroidRuntime(2516): Shutting down VM
08-18 19:08:10.674: DEBUG/VoiceDialerReceiver(2378): onReceive Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:com.apps.epicad.andrewapp flg=0x10000000 cmp=com.android.voicedialer/.VoiceDialerReceiver (has extras) }
08-18 19:08:10.674: VERBOSE/RecognizerEngine(2378): deleteCachedGrammarFiles /data/data/com.android.voicedialer/files/openentries.txt
08-18 19:08:10.704: DEBUG/dalvikvm(2516): GC_CONCURRENT freed 103K, 69% free 323K/1024K, external 0K/0K, paused 1ms+1ms
08-18 19:08:10.704: INFO/AndroidRuntime(2516): NOTE: attach of thread 'Binder Thread #3' failed
08-18 19:08:10.704: DEBUG/vicky(1059): vicky received: android.intent.action.PACKAGE_REMOVED
08-18 19:08:10.704: DEBUG/jdwp(2516): Got wake-up signal, bailing out of select
08-18 19:08:10.704: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)
08-18 19:08:10.714: DEBUG/dalvikvm(2516): Debugger has detached; object registry had 1 entries
08-18 19:08:10.844: DEBUG/dalvikvm(2737): GC_EXTERNAL_ALLOC freed 59K, 44% free 5666K/10055K, external 25606K/25635K, paused 51ms
08-18 19:08:10.894: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)
08-18 19:08:10.904: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)
08-18 19:08:10.904: INFO/RegisterService(2387): android.intent.action.PACKAGE_REMOVED package:com.apps.epicad.andrewapp
08-18 19:08:10.924: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837552
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837527
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837559
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837508
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837627
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837513
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837504
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837518
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837648
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130838372
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130838095
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130838178
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837562
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837562
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837691
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837608
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130837542
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130903040
08-18 19:08:10.994: WARN/Addapter(2737): info.icon:2130903040
08-18 19:08:11.465: DEBUG/szipinf(1547): Initializing inflate state
08-18 19:08:11.525: WARN/Addapter(2737): info.icon:2130837552
08-18 19:08:11.525: WARN/Addapter(2737): info.icon:2130837527
08-18 19:08:11.535: WARN/Addapter(2737): info.icon:2130837559
08-18 19:08:11.535: WARN/Addapter(2737): info.icon:2130837508
08-18 19:08:11.535: WARN/Addapter(2737): info.icon:2130837627
08-18 19:08:11.535: WARN/Addapter(2737): info.icon:2130837513
08-18 19:08:11.535: WARN/Addapter(2737): info.icon:2130837504
08-18 19:08:11.535: WARN/Addapter(2737): info.icon:2130837518
08-18 19:08:11.535: WARN/Addapter(2737): info.icon:2130837648
08-18 19:08:11.535: WARN/Addapter(2737): info.icon:2130838372
08-18 19:08:11.535: WARN/Addapter(2737): info.icon:2130838095
08-18 19:08:11.545: WARN/Addapter(2737): info.icon:2130838178
08-18 19:08:11.545: WARN/Addapter(2737): info.icon:2130837562
08-18 19:08:11.545: WARN/Addapter(2737): info.icon:2130837562
08-18 19:08:11.545: WARN/Addapter(2737): info.icon:2130837691
08-18 19:08:11.545: WARN/Addapter(2737): info.icon:2130837608
08-18 19:08:11.545: WARN/Addapter(2737): info.icon:2130837542
08-18 19:08:11.545: WARN/Addapter(2737): info.icon:2130903040
08-18 19:08:11.545: WARN/Addapter(2737): info.icon:2130903040
08-18 19:08:11.595: INFO/RosieUtility(921): disable self killer: mEnabled=1
08-18 19:08:11.605: INFO/RosieUtility(921): enable self killer: mEnabled=0
08-18 19:08:11.615: DEBUG/HtcWidgetScanner(921): action - android.intent.action.PACKAGE_REMOVED
08-18 19:08:11.615: INFO/RosieUtility(921): disable self killer: mEnabled=1
08-18 19:08:11.615: DEBUG/HtcWidgetScanner(921): packageUid - 10161
08-18 19:08:11.625: INFO/RosieUtility(921): enable self killer: mEnabled=0
08-18 19:08:11.645: DEBUG/StatusBarPolicy(1531): onSignalStrengthsChanged
08-18 19:08:11.645: DEBUG/StatusBarPolicy(1531): ATT SignalStrength:  asu=5 signalDbm=103 ecno=20
08-18 19:08:11.665: DEBUG/VoiceDialerReceiver(2378): onReceive Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.apps.epicad.andrewapp flg=0x10000000 cmp=com.android.voicedialer/.VoiceDialerReceiver (has extras) }
08-18 19:08:11.665: VERBOSE/RecognizerEngine(2378): deleteCachedGrammarFiles /data/data/com.android.voicedialer/files/openentries.txt
08-18 19:08:11.695: DEBUG/vicky(1059): vicky received: android.intent.action.PACKAGE_ADDED
08-18 19:08:11.715: INFO/RegisterService(2387): android.intent.action.PACKAGE_ADDED package:com.apps.epicad.andrewapp
08-18 19:08:11.725: INFO/RosieUtility(921): disable self killer: mEnabled=1
08-18 19:08:11.725: INFO/RosieUtility(921): enable self killer: mEnabled=0
08-18 19:08:11.745: DEBUG/HtcWidgetScanner(921): action - android.intent.action.PACKAGE_ADDED
08-18 19:08:11.745: INFO/RosieUtility(921): disable self killer: mEnabled=1
08-18 19:08:11.745: DEBUG/HtcWidgetScanner(921): packageUid - 10161
08-18 19:08:11.745: INFO/RosieUtility(921): enable self killer: mEnabled=0
08-18 19:08:11.805: INFO/RegisterService(2387): android.intent.action.PACKAGE_REPLACED package:com.apps.epicad.andrewapp
08-18 19:08:11.935: DEBUG/AndroidRuntime(2540): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
08-18 19:08:11.935: DEBUG/AndroidRuntime(2540): CheckJNI is OFF
08-18 19:08:11.935: DEBUG/dalvikvm(2540): creating instr width table
08-18 19:08:12.086: DEBUG/PhoneApp(1544): EVENT_QUERY_MO_PACKAGES
08-18 19:08:12.086: DEBUG/PhoneApp(1544): -- N1 =0
08-18 19:08:12.096: DEBUG/PhoneApp(1544): -- N2 =0
08-18 19:08:12.106: DEBUG/PhoneApp(1544): -- N3 =0
08-18 19:08:12.126: DEBUG/AndroidRuntime(2540): Calling main entry com.android.commands.am.Am
08-18 19:08:12.126: INFO/ActivityManager(1310): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.apps.epicad.andrewapp/.SplashActivity } from pid 2540
08-18 19:08:12.156: VERBOSE/HtcAppUsageStats(1310): (launch app, package): (AndrewApp, com.apps.epicad.andrewapp)
08-18 19:08:12.156: DEBUG/AndroidRuntime(2540): Shutting down VM
08-18 19:08:12.166: INFO/[POST_RESELECT](2737): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4012ceb0,-1,0,-1,0)
08-18 19:08:12.166: INFO/[POST_RESELECT](2737): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@40140890,-1,0,-1,0)
08-18 19:08:12.166: DEBUG/Background traffic light(2737): traffic light: GREEN, mBackgroundTrafficLight = true
08-18 19:08:12.176: INFO/ActivityManager(1310): Start proc com.apps.epicad.andrewapp for activity com.apps.epicad.andrewapp/.SplashActivity: pid=2548 uid=10161 gids={}
08-18 19:08:12.206: DEBUG/Sensors(1310): Enable akm: en = 1
08-18 19:08:12.206: DEBUG/SensorService(1310): noteStartSensor: uid = 0x3e8, handle = 0x0
08-18 19:08:12.226: INFO/AndroidRuntime(2540): NOTE: attach of thread 'Binder Thread #3' failed
08-18 19:08:12.226: DEBUG/AK8975(1223): Compass Start
08-18 19:08:12.266: DEBUG/SurfaceFlinger(1310): layer=0x65b980 is not in the purgatory list
08-18 19:08:12.366: WARN/InputManagerService(1310): [unbindCurrentClientLocked] Disable input method client.
08-18 19:08:12.366: WARN/InputManagerService(1310): [startInputLocked] Enable input method client.
08-18 19:08:12.386: WARN/dalvikvm(2737): disableGcForExternalAlloc: false
08-18 19:08:12.396: DEBUG/dalvikvm(2540): GC_CONCURRENT freed 104K, 66% free 353K/1024K, external 0K/0K, paused 5ms+1ms
08-18 19:08:12.396: DEBUG/jdwp(2540): Got wake-up signal, bailing out of select
08-18 19:08:12.396: DEBUG/dalvikvm(2540): Debugger has detached; object registry had 1 entries
08-18 19:08:12.546: INFO/ActivityManager(1310): Displayed com.apps.epicad.andrewapp/.SplashActivity: +368ms
08-18 19:08:12.696: DEBUG/SurfaceFlinger(1310): layer=0x90c838 is not in the purgatory list
08-18 19:08:13.177: DEBUG/ConnectivityService(1310): getMobileDataEnabled returning true
08-18 19:08:16.190: DEBUG/ConnectivityService(1310): getMobileDataEnabled returning true
08-18 19:08:17.311: INFO/ActivityManager(1310): Starting activity: Intent { act=com.apps.epicad.ANDREWAPP cmp=com.apps.epicad.andrewapp/.MainActivity } from pid 2548
08-18 19:08:17.501: DEBUG/StatusBarPolicy(1531): onSignalStrengthsChanged
08-18 19:08:17.501: DEBUG/StatusBarPolicy(1531): ATT SignalStrength:  asu=3 signalDbm=107 ecno=21
08-18 19:08:17.581: INFO/ActivityManager(1310): Displayed com.apps.epicad.andrewapp/.MainActivity: +263ms
08-18 19:08:17.591: DEBUG/SurfaceFlinger(1310): layer=0x691b08 is not in the purgatory list
08-18 19:08:19.202: DEBUG/ConnectivityService(1310): getMobileDataEnabled returning true
08-18 19:08:19.503: DEBUG/AndroidRuntime(2548): Shutting down VM
08-18 19:08:19.503: WARN/dalvikvm(2548): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0)
08-18 19:08:19.503: INFO/ActivityManager(1310): Starting activity: Intent { act=com.apps.epicad.USELESS } from pid 2548
08-18 19:08:19.513: ERROR/AndroidRuntime(2548): FATAL EXCEPTION: main
08-18 19:08:19.513: ERROR/AndroidRuntime(2548): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.apps.epicad.USELESS }
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1569)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1539)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.app.Activity.startActivityForResult(Activity.java:2901)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.app.Activity.startActivity(Activity.java:3007)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at com.apps.epicad.andrewapp.MainActivity$1.onClick(MainActivity.java:25)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.view.View.performClick(View.java:2532)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.view.View$PerformClick.run(View.java:9277)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.os.Handler.handleCallback(Handler.java:587)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.os.Handler.dispatchMessage(Handler.java:92)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.os.Looper.loop(Looper.java:143)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at android.app.ActivityThread.main(ActivityThread.java:4196)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at java.lang.reflect.Method.invokeNative(Native Method)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at java.lang.reflect.Method.invoke(Method.java:507)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-18 19:08:19.513: ERROR/AndroidRuntime(2548):     at dalvik.system.NativeStart.main(Native Method)
08-18 19:08:19.513: WARN/ActivityManager(1310):   Force finishing activity com.apps.epicad.andrewapp/.MainActivity
08-18 19:08:19.833: DEBUG/SurfaceFlinger(1310): layer=0x90c838 is not in the purgatory list
08-18 19:08:20.013: WARN/ActivityManager(1310): Activity pause timeout for HistoryRecord{406b5360 com.apps.epicad.andrewapp/.MainActivity}
08-18 19:08:21.445: INFO/Process(2548): Sending signal. PID: 2548 SIG: 9
08-18 19:08:21.495: ERROR/InputDispatcher(1310): channel '406b0f48 com.apps.epicad.andrewapp/com.apps.epicad.andrewapp.SplashActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
08-18 19:08:21.495: ERROR/InputDispatcher(1310): channel '406b0f48 com.apps.epicad.andrewapp/com.apps.epicad.andrewapp.SplashActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
08-18 19:08:21.495: INFO/ActivityManager(1310): Process com.apps.epicad.andrewapp (pid 2548) has died.
08-18 19:08:21.505: INFO/WindowManager(1310): WINDOW DIED Window{406b0f48 com.apps.epicad.andrewapp/com.apps.epicad.andrewapp.SplashActivity paused=false}
08-18 19:08:21.515: ERROR/InputDispatcher(1310): channel '4070fd50 com.apps.epicad.andrewapp/com.apps.epicad.andrewapp.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
08-18 19:08:21.515: ERROR/InputDispatcher(1310): channel '4070fd50 com.apps.epicad.andrewapp/com.apps.epicad.andrewapp.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
08-18 19:08:21.515: INFO/WindowManager(1310): WINDOW DIED Window{4070fd50 com.apps.epicad.andrewapp/com.apps.epicad.andrewapp.MainActivity paused=false}
08-18 19:08:21.515: ERROR/ActivityManager(1310): fail to set top app changed!
08-18 19:08:21.525: INFO/WindowManager(1310): WIN DEATH: Window{4070fd50 com.apps.epicad.andrewapp/com.apps.epicad.andrewapp.MainActivity paused=false}
08-18 19:08:21.545: DEBUG/Sensors(1310): Enable akm: en = 0
08-18 19:08:21.545: DEBUG/SensorService(1310): noteStopSensor: uid = 0x3e8, handle = 0x0
08-18 19:08:21.565: INFO/CarouselTimeLog(2737): onStart() finish: 1313719701567
08-18 19:08:21.565: DEBUG/CarouselDummyActivity(2737): CarouselDummyActivity.onResume: tab_allapps
08-18 19:08:21.565: DEBUG/Background traffic light(2737): traffic light: RED, mBackgroundTrafficLight = true
08-18 19:08:21.575: DEBUG/William(2737): - refreshUsageStatCache -
08-18 19:08:21.585: DEBUG/EASAppSvc(836): [ NA ]INTENT_PAUSE_SYNC:com.htc.launcher
08-18 19:08:21.605: DEBUG/InputManagerService(1310): Got RemoteException sending setActive(false) notification to pid 2548 uid 10161
08-18 19:08:21.605: WARN/InputManagerService(1310): [startInputLocked] Enable input method client.
08-18 19:08:21.625: DEBUG/AutoSetting(25998): service - mBroadcastReceiver: action = com.htc.content.Intent.ACTION_BACKGROUND_OP_STOP
08-18 19:08:21.625: DEBUG/EASAppSvc(836): [ NA ]setPause(com.htc.launcher)
08-18 19:08:21.645: DEBUG/SurfaceFlinger(1310): layer=0x691b08 is not in the purgatory list
08-18 19:08:21.645: DEBUG/EASAppSvc(836): [ NA ]MainHandlerThread: msg:{ what=33 when=-1d22h30m6s909ms }
08-18 19:08:21.655: DEBUG/EASRequestController(836): [Acc -1][syncSrcs=null]checkQueue(): paused
08-18 19:08:21.655: DEBUG/EASEventBroadcaster(836): [ NA ]resendSyncEvent(): exSyncSources is null, skip
08-18 19:08:21.735: DEBUG/SurfaceFlinger(1310): layer=0x65b980 is not in the purgatory list
08-18 19:08:21.745: DEBUG/AK8975(1223): Compass CLOSE 
08-18 19:08:22.215: DEBUG/ConnectivityService(1310): getMobileDataEnabled returning true
08-18 19:08:23.196: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)
08-18 19:08:23.216: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)
08-18 19:08:23.397: DEBUG/DEBUG(2737): updateCellLayoutCache(3.5555556, 3.5607476)

所以它看起来像logcat说没有Activity来处理意图,但我很确定它有。

2 个答案:

答案 0 :(得分:3)

嗯......快速浏览一下,有几个问题。您的孩子活动名称是UselessActivity,而不是Useless。活动也与主要有关。

无论如何,你可以在调用活动时尝试这一行:

Intent intent = new Intent(MainActivity.this,UselessActivity.class);

然后你可以从那里去。

答案 1 :(得分:0)

首先通过在清单文件中进行 LAUNCHER 活动来检查您的无用活动是否存在任何错误。如果正确加载,请尝试调用如下所示的意图

Intent i = new Intent(this, UselessActivity.class);
startActivity(i);