问题描述
我想开始从preferenceActivity一个新的活动。然而,它失败,无法找到明确的活动课。你宣布你的AndroidManifest.xml这个活动?
I'm trying to start a new Activity from a PreferenceActivity. However, it fails with "Unable to find explicit activity class. Have you declared this activity in your AndroidManifest.xml?"
嗯,是的,我宣布它:
<application [......] android:debuggable="true">
<activity android:name=".AlarmSettings"
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=".FlashLightActivity"></activity>
<receiver
android:name="AlarmReceiver"
android:process=":remote" >
</receiver>
</application>
AlarmSettings是我的preferenceActivity。 AlarmSettings称FlashLightActivity是这样的:
AlarmSettings is my PreferenceActivity. AlarmSettings calls FlashLightActivity this way:
Intent i = new Intent(AlarmSettings.this, FlashLightActivity.class);
startActivity(i);
这是FlashLightActivity:
And this is FlashLightActivity:
public class FlashLightActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.flashlight);
}
}
...我不知道该怎么办。任何想法?
... I don't know what to do. Any ideas?
推荐答案
海报复印的解决方案进入了答案部分,以从未答复的过滤器去除这样的:
Copying poster's solution into the answer section, in order to remove this from the "Unanswered" filter:
这是不符合我的code的一个问题,但与Eclipse和Android SDK。在Eclipse - 经过一番研究,我做了>检查更新帮助 和一切工作了。
这篇关于安卓:无法找到明确的活动课... startActivity从preferenceActivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!