On Mon, Aug 17, 2009 at 10:03 PM, Honest <honestsucc...@gmail.com> wrote:
> <?xml version="1.0" encoding="utf-8"?> > <manifest xmlns:android="http://schemas.android.com/apk/res/android" > package="com.saltriver.service" > android:versionCode="1" > android:versionName="1.0"> > <application android:icon="@drawable/icon" android:label="@string/ > app_name"> > <activity android:name=".ServiceExample" > android:label="@string/app_name"> > <intent-filter> > <action android:name="android.intent.action.MAIN" /> > <category > android:name="android.intent.category.LAUNCHER" /> > </intent-filter> > </activity> > </application> > <service android:name=".service.MyService"> Change this to just android:name=".MyService" (presumably you don't have it in a sub-package). > <intent-filter> > </intent-filter> There is no reason to have an empty intent-filter; get rid of these tags. > </service> > <uses-sdk android:minSdkVersion="3" /> > <uses-permission android:name="android.permission.READ_FRAME_BUFFER"></ > uses-permission> Unrelated, but applications can't get the READ_FRAME_BUFFER permission. > > </manifest> > > > I am calling service by folllowing code from the activity. > > > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > try > { > setContentView(R.layout.main); > Intent serviceIntent = new Intent(); > > serviceIntent.setAction(".service.MyService"); Construct the Intent like this: intent = new Intent(this, MyService.class); > startService(serviceIntent); > } > catch(Exception e) > { > Toast.makeText(this, "excepiton"+e.toString(), > Toast.LENGTH_LONG).show(); > > } > > } > > > > > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---