java - Service not starting when button is pressed? -


I know that a hundred times before it has been asked, but nothing is working for me I have a There is a service in a different category that requires a push button after launch from a launch entity .

Long story short, here's my goal:

Wait three seconds for the running commands & gt; Launch app & gt; Start Service

Monitor the service CONFIGURATION_CHANGED broadcast.

Reveal (parts which are important):

  & lt; / Activity & gt; & Lt; Receiver Android: name = "MyReceiver" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.CONFIGURATION_CHANGED" & gt; & Lt; / Action & gt; & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; & Lt; Service Android: Enabled = "True" Android: name = ". MyService" /> & Lt; / Application & gt; & Lt; / Reveal & gt;   

MyService.java:

  import android.content.Context; Import android.content.Intent; Android Import android.widget.Toast; Import android.app.Service; Public class service expands MyService {string [] commandsdefault = {"/ x"}; Create on public zeros () {toast. Make Text (this, "X", Toast. LNNHHHRT); } Public Zero Bedesto () {Toast. Make Text (this, "X", Toast. LNGHHRT); } Public vacuum receiver (reference reference, intent to intent) {main activity ogres = new main activity (); Ogres.RunAsRoot (commandsdefault); } @ Override Public Wide Onstart (intent of intention, int-start) {toast. Make Text (this, "X", Toast. LNNHHHRT); } @ Override public ibindor on bind (intent to intent) {return tap; }}   

And then in my main activity, I have the following line to call to start javascript:

  startService (new intent ( GetApplicationContext), MyService.class));   

I am more confused than a mosquito in the effigy shop. Logcat did not exactly u = 0 found .

Nothing is returning useful. Do I have something wrong here? I am not even seeing tiists from starting the service.

Ensure that your service has been announced in the Android manifest

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -