2012-03-27 71 views
0

我的Android應用程序出現問題。錯誤occures當我要運行我在模擬器或真實設備中的應用:找不到活動

[2012-03-27 12:01:30 - CallApp] Android Launch! 
[2012-03-27 12:01:30 - CallApp] adb is running normally. 
[2012-03-27 12:01:30 - CallApp] No Launcher activity found! 
[2012-03-27 12:01:30 - CallApp] The launch will only sync the application package on the device! 
[2012-03-27 12:01:30 - CallApp] Performing sync 
[2012-03-27 12:01:30 - CallApp] Automatic Target Mode: Several compatible targets. Please select a target device. 
[2012-03-27 12:01:32 - CallApp] Uploading CallApp.apk onto device 'emulator-5554' 
[2012-03-27 12:01:33 - CallApp] Installing CallApp.apk... 
[2012-03-27 12:01:36 - CallApp] Success! 
[2012-03-27 12:01:36 - CallApp] \CallApp\bin\CallApp.apk installed on device 
[2012-03-27 12:01:36 - CallApp] Done! 

我已經檢查了我的清單-文件,但也有必要啓動和主語句:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="de.CallApp.CallApp" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk android:minSdkVersion="10" /> 

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 
    <uses-permission android:name="android.permission.RECEIVE_SMS" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.BATTERY_STATS" /> 
    <uses-permission android:name="android.permission.CALL_PHONE" /> 
    <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 

    <application 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" > 
     <receiver android:name=".receiver.BootBroadcastReceiver" > 
      <intent-filter> 
       <action android:name="android.intent.action.BOOT_COMPLETED" /> 
      </intent-filter> 
     </receiver> 
     <receiver android:name=".receiver.SmsBroadcastReceiver" > 
      <intent-filter android:priority="99999999" > 
       <action android:name="android.provider.Telephony.SMS_RECEIVED" /> 
      </intent-filter> 
     </receiver> 

     <activity 
      android:name="de.CallApp.CallApp.CallAppActivity" 
      android:configChanges="keyboardHidden|orientation" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <category android:name="android.intent.category.LAUNCHER" /> 

       <action android:name="android.intent.action.MAIN" /> 

       <action android:name="android.intent.action.ACTION_BATTERY_LOW" /> 
       <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 
+0

請發表你的整個清單文件。 – Rajkiran 2012-03-27 10:17:18

+0

您是否將SDCARD添加到您的模擬器? – Behnam 2012-03-27 10:23:47

回答

0

設置意圖過濾爲您的活動如下de.CallApp.CallApp.CallAppActivity

<intent-filter> 
    <action android:name="android.intent.action.MAIN" /> 
    <category android:name="android.intent.category.LAUNCHER" /> 
    </intent-filter> 

    <intent-filter> 
    <action android:name="android.intent.action.ACTION_BATTERY_LOW" /> 
    </intent-filter> 

    <intent-filter> 
    <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" /> 
    </intent-filter> 
+0

哈哈,我快了:) – 2012-03-27 10:27:45

+0

哈哈哈......... :) – waqaslam 2012-03-27 10:29:38

1

您應該將動作拆分爲多個意圖過濾器。 像:

 <intent-filter> 
      <category android:name="android.intent.category.LAUNCHER" /> 
      <action android:name="android.intent.action.MAIN" /> 
     </intent-filter> 

     <intent-filter> 
      <action android:name="android.intent.action.ACTION_BATTERY_LOW" /> 
     </intent-filter> 

     <intent-filter> 
      <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" /> 
     </intent-filter> 

否則它不會被識別