Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to start service Intent. Fora Dictionary
    text
    copied!<p>i try translate a word via Fora Dictionary Api. <a href="http://ng-comp.com/fora/fora_api.txt" rel="nofollow">Here</a> more about ForaApi. Here is my code:</p> <pre><code> String query = "com.ngc.fora.action.QUERY"; Intent foraIntent = new Intent(query); foraIntent.putExtra("QUERY_ID", new Long("1")); foraIntent.putExtra("QUERY", lword); foraIntent.putExtra("MAX_RESULTS", 2); foraIntent.putExtra("AS_PAGE", true); foraIntent.putExtra("CALLBACK_ACTION", "com.myAPP.ServiceForFora.TRANSLATE"); foraIntent.putExtra("CALLBACK_PACKAGE", "com.myAPP"); foraIntent.putExtra("CALLBACK_CLASS", ".ServiceForFora"); startService(foraIntent); </code></pre> <p>But when Fora Dictionary try send intent to my service(ServiceForFora) i get this: </p> <p><em><strong>05-07 06:20:40.440: W/ActivityManager(52): Unable to start service Intent { act=com.myAPP.ServiceForFora.TRANSLATE cmp=com.myAPP/.ServiceForFora (has extras) }: not found</em></strong></p> <p>Here's my service:</p> <pre><code>epublic class ServiceForFora extends Service{ @Override public IBinder onBind(Intent intent) { Toast.makeText(this, "onBind", Toast.LENGTH_LONG).show(); return null; } @Override public void onCreate() { //code to execute when the service is first created Toast.makeText(this, "onCreate", Toast.LENGTH_LONG).show(); super.onCreate(); } @Override public void onDestroy() { //code to execute when the service is shutting down super.onDestroy(); } @Override public int onStartCommand(Intent intent, int flags, int startId) { //code to execute when the service is starting up super.onStart(intent, startId); return Service.START_STICKY; } </code></pre> <p>}</p> <p>and Manifest notation:</p> <pre><code>&lt;application&gt;&lt;service android:name="com.myAPP.ServiceForFora" android:exported="true"&gt; &lt;intent-filter&gt; &lt;action android:name="com.myAPP.ServiceForFora.TRANSLATE"/&gt; &lt;/intent-filter&gt; &lt;/service&gt; ............................. &lt;/application&gt; </code></pre> <p>Thank's</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload