0

为什么当我尝试启动我的 android 程序时出现此错误:我不知道我在编码方面做错了什么,但我的代码中没有红色错误,即使是 xml。这发生在我使用包管理器之后我认为这是原因,但我不知道该类对我的程序做了什么这里是我认为导致问题的代码

PackageManager pm = getApplicationContext().getPackageManager();
pm.setComponentEnabledSetting(getComponentName(),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);

[2013-10-09 22:27:42 - OcTranspoDestination] ------------------------------
[2013-10-09 22:27:42 - OcTranspoDestination] Android Launch!
[2013-10-09 22:27:42 - OcTranspoDestination] adb is running normally.
[2013-10-09 22:27:42 - OcTranspoDestination] Performing com.example.octranspodestination.MainActivity activity launch
[2013-10-09 22:27:42 - OcTranspoDestination] Uploading OcTranspoDestination.apk onto device '9856d1df'
[2013-10-09 22:27:42 - OcTranspoDestination] Installing OcTranspoDestination.apk...
[2013-10-09 22:27:44 - OcTranspoDestination] Success!
[2013-10-09 22:27:44 - OcTranspoDestination] Starting activity com.example.octranspodestination.MainActivity on device 9856d1df
[2013-10-09 22:27:45 - OcTranspoDestination] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.octranspodestination/.MainActivity }
[2013-10-09 22:27:45 - OcTranspoDestination] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2013-10-09 22:27:48 - OcTranspoDestination] Starting activity com.example.octranspodestination.MainActivity on device 9856d1df
[2013-10-09 22:27:48 - OcTranspoDestination] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.octranspodestination/.MainActivity }
[2013-10-09 22:27:48 - OcTranspoDestination] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2013-10-09 22:27:51 - OcTranspoDestination] Starting activity com.example.octranspodestination.MainActivity on device 9856d1df
[2013-10-09 22:27:52 - OcTranspoDestination] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.octranspodestination/.MainActivity }
[2013-10-09 22:27:52 - OcTranspoDestination] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2013-10-09 22:27:55 - OcTranspoDestination] Starting activity com.example.octranspodestination.MainActivity on device 9856d1df
[2013-10-09 22:27:55 - OcTranspoDestination] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.octranspodestination/.MainActivity }
[2013-10-09 22:27:55 - OcTranspoDestination] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2013-10-09 22:27:58 - OcTranspoDestination] Starting activity com.example.octranspodestination.MainActivity on device 9856d1df
[2013-10-09 22:27:59 - OcTranspoDestination] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.octranspodestination/.MainActivity }
[2013-10-09 22:27:59 - OcTranspoDestination] ActivityManager: Error type 3
[2013-10-09 22:27:59 - OcTranspoDestination] ActivityManager: Error: Activity class {com.example.octranspodestination/com.example.octranspodestination.MainActivity} does not exist.

这是我使用的清单

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.octranspodestination"
    android:versionCode="1"
    android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />   
    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/button_focused"
        android:label="@string/app_name"
        android:theme="@style/Theme.MyStyle" >
        <activity
            android:name="com.example.octranspodestination.MainActivity"
            android:label="@string/app_name"
             >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <EditText
                 android:id="@+id/searchBox"        
                 android:layout_width="fill_parent"
                 android:layout_height="45dp"
                 android:background="@drawable/textinputborder"
                 android:paddingLeft="10dp"
                 android:inputType="text" >

             </EditText>

        </activity>


        <activity android:name=".OtherActivity">
        <!-- enable the search dialog to send searches to SearchableActivity -->
        <meta-data android:name="android.app.default_searchable"
                   android:value=".SearchableActivity" />
        </activity>
        <activity android:name=".SearchBusStation"></activity>
    </application>
</manifest>
4

1 回答 1

0
android:name="com.example.octranspodestination.MainActivity"

may change into

android:name=".MainActivity"
于 2013-10-10T03:21:30.127 回答