如何解决这个错误android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] cmp =

时间:2011-07-20 14:25:22

标签: android

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="Test.bed"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="4" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Home"

                  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=".Web_services" android:label="@string/app_name" android:configChanges="orientation"></activity>  
<activity android:name=".Reservation" android:label="@string/app_name" ></activity>
 <activity android:name=".Json_services" android:label="@string/app_name" ></activity>
<activity android:name=".HealthGraph" android:label="@string/app_name" ></activity>
<activity android:name=".HealthGraphVal" android:label="@string/app_name" ></activity>
<service android:enabled="true" android:name=".HealthGraphService" />
<service android:enabled="true" android:name=".HealthGraphVal" />
    </application>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

错误

[2011-07-20 16:21:44 - Ac] Android Launch!
[2011-07-20 16:21:44 - Ac] adb is running normally.
[2011-07-20 16:21:44 - Ac] Performing Test.bed.Home activity launch
[2011-07-20 16:21:44 - Ac] Automatic Target Mode: using device 'HT9BJL902969'
[2011-07-20 16:21:45 - Ac] Uploading Ac.apk onto device 'HT9BJL902969'
[2011-07-20 16:21:45 - Ac] Installing Ac.apk...
[2011-07-20 16:21:54 - Ac] Success!
[2011-07-20 16:21:54 - Ac] Starting activity Test.bed.Home on device HT9BJL902969
[2011-07-20 16:21:59 - Ac] ActivityManager: DDM dispatch reg wait timeout
[2011-07-20 16:21:59 - Ac] ActivityManager: Can't dispatch DDM chunk 52454151: no handler defined
[2011-07-20 16:21:59 - Ac] ActivityManager: Can't dispatch DDM chunk 48454c4f: no handler defined
[2011-07-20 16:21:59 - Ac] ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined
[2011-07-20 16:21:59 - Ac] ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined
[2011-07-20 16:22:03 - Ac] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=Test.bed/.Home }

这是logcat

07-20 16:37:06.718: VERBOSE/BackupManagerService(92):     PackageInfo{44d68f58 com.htc.provider.settings} agent=com.htc.provider.settings.BackupAgent uid=10001 killAfterRestore=false restoreNeedsApplication=false
07-20 16:37:07.348: DEBUG/dalvikvm(4720): GC freed 560 objects / 48320 bytes in 472ms
07-20 16:37:07.798: DEBUG/dalvikvm(92): GC freed 6333 objects / 347136 bytes in 663ms
07-20 16:37:07.818: DEBUG/ImagesWidgetProvider(4631): OnReceive:Action: android.appwidget.action.APPWIDGET_UPDATE
07-20 16:37:07.818: DEBUG/ImagesWidgetProvider(4631): onUpdate(): 
07-20 16:37:08.128: DEBUG/HtcWidgetScanner(344): action - android.intent.action.PACKAGE_ADDED
07-20 16:37:08.148: DEBUG/HtcWidgetScanner(344): packageUid - 10110
07-20 16:37:09.348: INFO/ActivityManager(92): Displayed activity Test.bed/.Home: 8330 ms (total 8330 ms)
07-20 16:37:09.568: DEBUG/PackageInstallationReceiver(250): Removing.../data/local/tmp/Test.bed.apk
07-20 16:37:10.058: DEBUG/vending(459): [150] LocalAssetCache.updateOnePackage(): No local info for Test.bed
07-20 16:37:10.078: ERROR/PackageInstallationReceiver(250): Remove /data/local/tmp/Test.bed.apk Fail!
07-20 16:37:10.108: WARN/System.err(250): java.io.IOException: Error running exec(). Commands: [/system/xbin/su, 0, /system/bin/rm, /data/local/tmp/Test.bed.apk] Working Directory: null Environment: null
07-20 16:37:10.188: WARN/System.err(250):     at java.lang.ProcessManager.exec(ProcessManager.java:196)
07-20 16:37:10.208: WARN/System.err(250):     at java.lang.Runtime.exec(Runtime.java:225)
07-20 16:37:10.218: WARN/System.err(250):     at java.lang.Runtime.exec(Runtime.java:313)
07-20 16:37:10.238: WARN/System.err(250):     at java.lang.Runtime.exec(Runtime.java:246)
07-20 16:37:10.258: WARN/System.err(250):     at com.htc.android.psclient.PackageInstallationReceiver.removeTempPackageFile(PackageInstallationReceiver.java:34)
07-20 16:37:10.288: WARN/System.err(250):     at com.htc.android.psclient.PackageInstallationReceiver.access$000(PackageInstallationReceiver.java:8)
07-20 16:37:10.308: WARN/System.err(250):     at com.htc.android.psclient.PackageInstallationReceiver$1.run(PackageInstallationReceiver.java:24)
07-20 16:37:10.328: WARN/System.err(250): Caused by: java.io.IOException: No such file or directory
07-20 16:37:10.348: DEBUG/vending(459): [152] LocalAssetCache.updateOnePackage(): No local info for Test.bed
07-20 16:37:10.358: WARN/System.err(250):     at java.lang.ProcessManager.exec(Native Method)
07-20 16:37:10.368: WARN/System.err(250):     at java.lang.ProcessManager.exec(ProcessManager.java:194)
07-20 16:37:10.388: WARN/System.err(250):     ... 6 more
07-20 16:37:10.968: DEBUG/NetworkLocationProvider(92): setMinTime: 0
07-20 16:37:11.208: DEBUG/WifiService(92): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44d81840}
07-20 16:37:11.218: DEBUG/WifiService(92): enable and start wifi due to updateWifiState
07-20 16:37:11.348: DEBUG/NetworkLocationProvider(92): onCellLocationChanged [1413,68270998]
07-20 16:37:11.788: DEBUG/ImagesWidgetProvider(4631): OnReceive:Action: android.appwidget.action.APPWIDGET_UPDATE
07-20 16:37:11.788: DEBUG/ImagesWidgetProvider(4631): onUpdate(): 
07-20 16:37:11.848: DEBUG/ImagesWidgetProvider(4631): OnReceive:Action: android.appwidget.action.APPWIDGET_UPDATE
07-20 16:37:11.848: DEBUG/ImagesWidgetProvider(4631): onUpdate(): 
07-20 16:37:11.908: DEBUG/ImagesWidgetProvider(4631): OnReceive:Action: android.appwidget.action.APPWIDGET_UPDATE
07-20 16:37:11.918: DEBUG/ImagesWidgetProvider(4631): onUpdate(): 
07-20 16:37:16.168: DEBUG/WifiService(92): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44d81840}
07-20 16:37:16.168: DEBUG/WifiService(92): enable and start wifi due to updateWifiState
07-20 16:37:16.228: DEBUG/ImagesWidgetProvider(4631): OnReceive:Action: android.appwidget.action.APPWIDGET_UPDATE
07-20 16:37:16.238: DEBUG/ImagesWidgetProvider(4631): onUpdate(): 
07-20 16:37:18.258: DEBUG/WifiService(92): ACTION_BATTERY_CHANGED pluggedType: 2
07-20 16:37:18.268: DEBUG/HtcLockScreen(92): onRefreshBatteryInfo: 71
07-20 16:37:18.308: INFO/global(92): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
07-20 16:37:18.348: INFO/global(92): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
07-20 16:37:18.348: DEBUG/BatteryService(92): isUsbConnected() = true
07-20 16:37:18.358: DEBUG/BatteryService(92): mPlugType = 2
07-20 16:37:18.398: DEBUG/UsbConnectedReceiver(250): action = psclient.intent.action.usb_status
07-20 16:37:18.408: DEBUG/UsbConnectedReceiver(250): ACTION_BATTERY_CHANGED
07-20 16:37:18.408: DEBUG/UsbConnectedReceiver(250): usbCurrentType = 2
07-20 16:37:18.408: DEBUG/UsbConnectedReceiver(250): Current type is same as previous, return!
07-20 16:37:21.228: DEBUG/ImagesWidgetProvider(4631): OnReceive:Action: android.appwidget.action.APPWIDGET_UPDATE
07-20 16:37:21.228: DEBUG/ImagesWidgetProvider(4631): onUpdate(): 
07-20 16:37:23.918: DEBUG/WifiService(92): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44d81840}
07-20 16:37:23.938: DEBUG/WifiService(92): enable and start wifi due to updateWifiState
07-20 16:37:23.938: DEBUG/NetworkLocationProvider(92): getLocation(): triggering a wifi scan
07-20 16:37:24.018: DEBUG/NetworkLocationProvider(92): onCellLocationChanged [1413,68270998]
07-20 16:37:24.521: INFO/wpa_supplicant(135): CTRL-EVENT-SCAN-RESULTS  Ready
07-20 16:37:24.528: INFO/wpa_supplicant(135): - wpa_supplicant_event_scan_results RETURN (ap_scan = 2)-
07-20 16:37:24.548: DEBUG/NetworkLocationProvider(92): updateWifIScanResults(): 4 APs
07-20 16:37:24.618: DEBUG/LocationMasfClient(92): getNetworkLocation(): Returning cache location with accuracy 76.0
07-20 16:37:24.668: VERBOSE/WeatherReporter(488):  WeatherAlertService   locationProvider LOCATION CHANGED lat/long - 62.389413999999995 17.257637166666665
07-20 16:37:24.678: DEBUG/LocationManagerService(92): Acquired wakelock
07-20 16:37:25.088: DEBUG/LocationMasfClient(92): getAddressFromProtoBuf(): Ignore feature 0,Sundsvall Municipality
07-20 16:37:25.098: DEBUG/LocationMasfClient(92): getAddressFromProtoBuf(): Ignore feature 0,Sundsvall Municipality
07-20 16:37:25.118: WARN/WeatherReporter(488):  WeatherAlertService   parsing address for geocode ZIP - country:SE locality:Sundsvall postalCode:85352
07-20 16:37:25.128: VERBOSE/WeatherReporter(488):  WeatherAlertService   updating deviceLocationZIP to 85352
07-20 16:37:25.128: VERBOSE/WeatherReporter(488):  WeatherAlertService   after parsing all geocode addresses deviceLocationZIP = 85352
07-20 16:37:25.138: DEBUG/LocationManagerService(92): Released wakelock
07-20 16:37:25.778: INFO/ActivityManager(92): Start proc com.google.android.apps.maps:LocationFriendService for service com.google.android.apps.maps/com.google.googlenav.friend.android.LocationFriendService: pid=4733 uid=10033 gids={3003, 1015}
07-20 16:37:25.828: DEBUG/LocationManagerService(92): Acquired wakelock
07-20 16:37:25.838: DEBUG/LocationManagerService(92): Released wakelock
07-20 16:37:25.968: INFO/dalvikvm(4733): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=38)
07-20 16:37:26.018: INFO/dalvikvm(4733): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=104)
07-20 16:37:26.228: DEBUG/ImagesWidgetProvider(4631): OnReceive:Action: android.appwidget.action.APPWIDGET_UPDATE

主页

package Test.bed;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class Home extends Activity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        GridView gridview = (GridView) findViewById(R.id.gridview);
        gridview.setAdapter(new ImageAdapter(this));

        gridview.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id)  {
                 switch (position) {
                 case 0:     
                    Intent intent = new Intent(v.getContext(),Settings.class);
                      startActivity(intent);
                 break;

                 case 1:     
                    Intent intent4 = new Intent(v.getContext(),Web_services.class);
                      startActivity(intent4);
                 break;



                default:    
                 break;
             }

         }


        });
    }

    public class ImageAdapter extends BaseAdapter {
        private Context mContext;

        public ImageAdapter(Context c) {
            mContext = c;
        }

        public int getCount() {
            return mThumbIds.length;
        }

        public Object getItem(int position) {
            return null;
        }

        public long getItemId(int position) {
            return 0;
        }

        // create a new ImageView for each item referenced by the Adapter
        public View getView(int position, View convertView, ViewGroup parent) {
            View grid;

            if (convertView == null) { // if it's not recycled, initialize some
                // attributes
                grid = new View(mContext);
                LayoutInflater inflater = getLayoutInflater();
                grid = inflater.inflate(R.layout.moodcus, parent, false);

            } else {
                grid = (View) convertView;

            }
            ImageView imageView = (ImageView) grid.findViewById(R.id.imgview);
            TextView textView = (TextView) grid.findViewById(R.id.txtview);
            imageView.setImageResource(mThumbIds[position]);
            textView.setText(mMoodnames[position]);
            return grid;
        }


        private Integer[] mThumbIds = { R.drawable.icon,R.drawable.icon};

        private String[] mMoodnames = { "Settings", "Webview"  };
    }


}

请指导

0 个答案:

没有答案