Logan Guo Logan Guo - 3 months ago 20
Android Question

Why I can not open android manifest class in eclipse?

In eclipse, if you press CTRL and click the method name, you can open declaration or implementation of this method. I want to use this idea to navigate to a class in android

manifest.xml
.
All other Activity or Service work just fine, but only Receiver does not.

see code below





<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.seafile.seadroid2"
android:versionCode="20"
android:versionName="1.0.1"
android:installLocation="internalOnly"
>

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:name="com.seafile.seadroid2.SeadroidApplication"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher">

<receiver android:name=".OSBootReceiver" >
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>

<activity android:name="com.seafile.seadroid2.BrowserActivity"
android:label="@string/app_name"
android:theme="@style/Theme.SeafileTheme"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<service android:name="com.seafile.seadroid2.sync.CameraUploadService" > </service>

</application>
</manifest>


I checked if the path was right, the class exists in that path, so why can't I click to open that class?
Anyone can help?

Answer

Your receiver is not using the full path. Try changing the declaration from:

<receiver android:name=".OSBootReceiver" >
    ...
</receiver>

to:

<receiver android:name="com.seafile.seadroid2.OSBootReceiver" >
    ...
</receiver>

I've found that Eclipse will only respond to a ctrl-click in a manifest file if the name is fully qualified.