[英]Android studio intent error
應用程序名稱:envi
主要活動調用screen1.java
和screen1.java
使用Intent
調用screen2
。 我收到以下錯誤:
Error:(24, 36) No resource found that matches the given name (at 'label' with value '@string/envi').
Error:(37, 36) No resource found that matches the given name (at 'label' with value '@string/envi').
這就是我的androidmanifest.xml的樣子
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.kriti.envi"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.kriti.envi.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<activity
android:name="com.example.kriti.envi.screen1"
android:label="@string/envi" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.kriti.envi.actvityscreen2"
android:label="@string/title_activity_actvityscreen2" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<activity
android:name="com.example.kriti.envi.screen2"
android:label="@string/envi" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
該問題可能是由於缺少帶有密鑰envi
字符串資源引起的。
但那里還有其他問題。 你的AndroidManifest.xml
錯了。
標記<intent-filter>
不能包含標記<activity>
,請參閱此處的文檔。
它只能包含<action>
, <category>
, <data>
標簽。 標簽<activity>
只能放在標簽<application>
。 因此,您的應用程序不知道名稱為com.example.kriti.envi.screen1
和com.example.kriti.envi.screen2
任何活動。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.