intent不能跳转怎么办
10-26 03:03:59.504: WARN/ActivityManager(60): Unable to start service Intent { cmp=com.mp3player/com.service.DownLoadService (has extras) }: not found 10-26 03:04:03.164: WARN/ActivityManager(60): Unable to start service Intent { cmp=com.mp3player/com.service.DownLoadService (has extras) }: not found 毕业论文
xml文件 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mp3player" android:versionCode="1" android:versionName="1.0" > <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:label="@string/app_name" android:name=".Mp3ListActivity" > <intent-filter > <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <service android:name=".DownLoadService"></service> </application> <uses-sdk android:minSdkVersion="8" /> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>
程序段 protected void onListItemClick(ListView l,View v,int position,long id){ Mp3Info mp3info = mp3infos.get(position); System.out.println("mp3info-------->" + mp3info); Intent intent = new Intent(); intent.putExtra("mp3info", mp3info); intent.setClass(this,DownLoadService.class); startService(intent); super.onListItemClick(l, v, position, id); }
<category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <service android:name="com.service.DownLoadService"></service> </application>
这样可以啦...
|