2013-10-30 106 views
0

你好,這是我的清單:爲什麼我沒有收到BOOT?

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.examples.android.calendar" 
android:installLocation="preferExternal" 
android:permission="android.permission.RECEIVE_BOOT_COMPLETED" 
android:versionCode="1" 
android:versionName="1.0" > 

<uses-sdk 
    android:minSdkVersion="8" 
    android:targetSdkVersion="18" /> 

<uses-permission android:name="android.permission.WRITE_CALENDAR" /> 
<uses-permission android:name="android.permission.READ_CALENDAR" /> 
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 
<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" /> 

<uses-feature 
    android:name="android.hardware.touchscreen" 
    android:required="false" /> 

<application 
    android:name="org.openintents.filemanager.FileManagerApplication" 
    android:icon="@drawable/appicon" 
    android:label="@string/app_name" > 
    <activity 
     android:name="com.examples.android.calendar.CalendarView" 
     android:theme="@style/Theme.Sherlock" > 
    </activity> 
    <activity 
     android:name="com.examples.android.calendar.DayView" 
     android:theme="@style/Theme.Sherlock" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.NewEvent03" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.Event04" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.EventEdit" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.Popup" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.Deadlinepopup02" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.Deadlinepopup04" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.NewInterview10" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.InterviewEvent11" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.EditInterview" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.InterviewOutcome14" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.Followup" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.interviewFollowup" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.NewEvent" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.EventList" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.NewReminderOrFollowup" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.JobList" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.NewGenericEvent" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.GenericEventEdit" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.Reminder" > 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.Login" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity android:name="com.examples.android.calendar.crisismate2.Dashboard" > 
    </activity> 
    <activity 
     android:name="com.examples.android.calendar.crisismate2.InterviewReminder12" 
     android:theme="@android:style/Theme.Dialog" > 
    </activity> 
    <activity 
     android:name="com.examples.android.calendar.crisismate2.InterviewReminder13" 
     android:theme="@android:style/Theme.Dialog" > 
    </activity> 
    <activity 
     android:name="com.examples.android.calendar.crisismate2.ReminderPopUp01" 
     android:theme="@android:style/Theme.Dialog" > 
    </activity> 
    <activity 
     android:name="com.examples.android.calendar.crisismate2.Welldone17" 
     android:theme="@android:style/Theme.Dialog" > 
    </activity> 
    <activity 
     android:name="com.examples.android.calendar.crisismate2.Ooops" 
     android:theme="@android:style/Theme.Dialog" > 
    </activity> 
    <activity 
     android:name="com.examples.android.calendar.crisismate2.Appliedjob01" 
     android:theme="@android:style/Theme.Dialog" > 
    </activity> 

    <receiver android:name="com.examples.android.calendar.crisismate2.OnBootReceiver" > 
     <intent-filter> 
      <action android:name="android.intent.action.BOOT_COMPLETED" /> 
     </intent-filter> 
    </receiver> 

    <service android:name="com.examples.android.calendar.crisismate2.OnBootService" > 
    </service> 

    <meta-data 
     android:name="com.a0soft.gphone.aTrackDog.testVersion" 
     android:value="28" /> 
    <meta-data 
     android:name="org.openintents.about" 
     android:resource="@xml/about" /> 

    <activity 
     android:name="org.openintents.filemanager.FileManagerActivity" 
     android:configChanges="keyboardHidden|orientation|screenSize" 
     android:label="@string/app_name" > 
     <meta-data 
      android:name="android.app.default_searchable" 
      android:value=".search.SearchableActivity" /> 
    </activity> 
    <activity 
     android:name="org.openintents.filemanager.bookmarks.BookmarkListActivity" 
     android:label="@string/bookmarks" > 
    </activity> 
    <activity 
     android:name="org.openintents.filemanager.PreferenceActivity" 
     android:label="@string/settings" /> 

    <!-- Filters for the Save as feature --> 
    <activity 
     android:name="org.openintents.filemanager.SaveAsActivity" 
     android:label="Save as" > 
     <intent-filter> 
      <action android:name="android.intent.action.VIEW" /> 

      <category android:name="android.intent.category.OPENABLE" /> 

      <data 
       android:mimeType="*/*" 
       android:scheme="content" /> 
     </intent-filter> 
    </activity> 

    <provider 
     android:name="org.openintents.filemanager.bookmarks.BookmarksProvider" 
     android:authorities="org.openintents.filemanager.bookmarks" > 
    </provider> 
    <provider 
     android:name="org.openintents.filemanager.search.SearchResultsProvider" 
     android:authorities="org.openintents.filemanager.search" > 
    </provider> 
    <provider 
     android:name="org.openintents.filemanager.search.SearchSuggestionsProvider" 
     android:authorities="org.openintents.filemanager.search.suggest" > 
    </provider> 
    <provider 
     android:name="org.openintents.filemanager.FileManagerProvider" 
     android:authorities="org.openintents.filemanager" 
     android:exported="true" > 
    </provider> 

    <!-- Activities from OI Distribution Library --> 
    <activity 
     android:name="org.openintents.distribution.EulaActivity" 
     android:theme="@android:style/Theme.DeviceDefault" /> 
    <activity 
     android:name="org.openintents.distribution.NewVersionActivity" 
     android:theme="@android:style/Theme.DeviceDefault" /> 
    <activity 
     android:name=".search.SearchableActivity" 
     android:launchMode="singleTop" > 
     <intent-filter> 
      <action android:name="android.intent.action.SEARCH" /> 
     </intent-filter> 

     <meta-data 
      android:name="android.app.searchable" 
      android:resource="@xml/searchable" /> 
    </activity> 

    <provider 
     android:name="org.openintents.filemanager.search.RecentsSuggestionsProvider" 
     android:authorities="org.openintents.filemanager.search.SuggestionProvider" > 
    </provider> 

    <service android:name="org.openintents.filemanager.search.SearchService" > 
    </service> 

    <activity 
     android:name="org.openintents.filemanager.IntentFilterActivity" 
     android:configChanges="keyboardHidden|orientation|screenSize" > 
     <intent-filter> 
      <action android:name="org.openintents.action.PICK_FILE" /> 

      <category android:name="android.intent.category.DEFAULT" /> 

      <data android:scheme="file" /> 
      <data android:mimeType="*/*" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="org.openintents.action.PICK_FILE" /> 

      <category android:name="android.intent.category.DEFAULT" /> 

      <data android:scheme="file" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="org.openintents.action.PICK_FILE" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="org.openintents.action.PICK_DIRECTORY" /> 

      <category android:name="android.intent.category.DEFAULT" /> 

      <data android:scheme="file" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="org.openintents.action.PICK_DIRECTORY" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="android.intent.action.GET_CONTENT" /> 

      <data android:mimeType="*/*" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
      <category android:name="android.intent.category.OPENABLE" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="android.intent.action.GET_CONTENT" /> 

      <data android:scheme="file" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
      <category android:name="android.intent.category.OPENABLE" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="android.intent.action.GET_CONTENT" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
      <category android:name="android.intent.category.OPENABLE" /> 
     </intent-filter> 

     <!-- Filter for multi select feature --> 
     <intent-filter> 
      <action android:name="org.openintents.action.MULTI_SELECT" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
    </activity> 
</application> 

</manifest> 

這是我的接收器:

package com.examples.android.calendar.crisismate2; 

import android.content.BroadcastReceiver; 
import android.content.Context; 

進口android.content.Intent; import android.util.Log;

public class OnBootReceiver extends BroadcastReceiver { 
@Override 
public void onReceive(Context context, Intent intent) { 
    Log.e("OnBootReceiver", "Hi, Mom!"); 
    Intent i = new Intent(context, OnBootService.class); 
    context.startService(i); 
} 
} 

爲什麼我沒有收到BOOT?

我沒有看到日誌「嗨,媽媽!」

感謝您的幫助!

+0

你重新啓動了嗎? – Darkhogg

+3

因爲android:installLocation =「preferExternal」 – njzk2

+2

你看過嗎:相關 4在我的N1啓動後,我的BroadcastReceiver沒有收到BOOT_COMPLETED意圖。請幫助! 2啓動接收器不工作 5啓動/屏幕廣播接收器不工作 3爲什麼我的活動在電話啓動時不啓動? 4爲什麼Android 4.0.3 PHONE HTC OneX中的「share-to」菜單項消失了?難以置信! – 2013-10-30 17:17:44

回答

1

刪除android:installLocation="preferExternal"它會工作。的Android廣播的BOOT_COMPLETED它安裝在外部存儲之前作爲Android Developer website

廣播接收機解釋監聽「啓動完成」之前外部存儲被安裝到所述設備 該系統提供的廣播ACTION_BOOT_COMPLETED。如果您的應用程序安裝在外部存儲器上,它永遠不會收到此廣播。

相關問題