在我AndroidManifest.xml中我有以下的發射活動(我只是添加了第二個活動,以默認的項目):無法從亞行
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.com.testapp.MainActivity"
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="com.example.com.testapp.TestActivity"
android:label="@string/title_activity_test" >
<intent-filter>
<action android:name="com.testapp.action.TEST_ACTION" />
</intent-filter>
</activity>
我想用ADB命令來啓動測試活動。我想:
./adb shell am start -a com.testapp.action.TEST_ACTION
但它給人的錯誤:
Error: Activity not started, unable to resolve Intent { act=com.testapp.action.TEST_ACTION flg=0x10000000 }
是否有人可以解釋爲什麼我收到此錯誤以及如何解決它?
編輯:
誰能告訴一個辦法只有用行動來推出的「測試活動」。
的第一個作品。爲什麼我不能只用動作來開始活動? – Jake
第一種情況不需要動作部分。 – Jake
您必須選擇活動才能運行與該活動相關的操作。 –