Wednesday 15 July 2015

sony xperia - No Activity to handle Intent for Illumination API -


Today the light was released to the API and when I click on it to create a simple app to show a glimpse of the light bar Try a button I just copied the code in the Sony Developers website, but it gives the error that there is no efficiency to handle this intention. Here is the main reason:

  package com.example.myillumin ; Import com.sonyericsson.illumination.IlluminationIntent; Importroid.os.Bundle; Import android App Import android.content.Intent; Import android.view.Menu; Import android.view.View; Import android.view.View.OnClickListener; Import android.widget.Button; Public class enhances main activity activity (personal button b1; @ override protected creature to zero) (bundle saved instenstate) {super.naught (savedinstenstate); setContentView (R.layout.activity_main); b1 = (button Find VBiID (R.B.ton1); B1.setOnClickListener (New OnClickListener () {@Override Click on Public Zero (see ARG0) {intent intention = new intentions (Intentions.action_ START_LED); Intentional Extra (Illumination) Intent.xtr _LLDOOLOR, 0xFFFF0000); Intentional Extra (Illumination Intent .com.example.myillumin "); startActivity;}}) @} Override Public Boolean On Crate Option Menu (menu menu) {getMenuInflater (). Arkmenu. Skriyta_men menu); return true;}}   

and here is the manifest file that I try to modify to see other posts by stack overflow.

  & quot; use-permission android: name = "com sonyericsson.illumination.permission.ILLUMINATION" /> & lt; Android Droid: allowBackup = "true" android: icon = "@drawable / ic_luncher" android: label = "@ string / app_name" Android: Theme = "@Style / Aaptim" & gt; & Lt; Activity Android: name = "com.example.myillumin.MainActivity" android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; Activity Android: name = "com.sonyericsson.illumination.IlluminationIntent" Android: label = "@ string / activity_name" Android: export = "false" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "com.sonyericsson.illumination.intent.action.START_LED" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; / Application & gt; & Lt; / Reveal & gt;   

Please help me: (

Lights Bar API Bar uses a 'service' to change color, so you do not want to start any activity.

then, in your code,

  effect intended = early Action (intent);           Instead of starting the activity, try to start the service with a built-in service:  
  current activity (intent);   

startService (intent);

You also may show whether support API call device check:

  effect CheckIntent = new intent (illuminate Intennt. Akshn_ STOP_LED); if (null == getPackageManager (). ResolveService (Chekinntent, PackageManager.GET_RESOLVED_FILTER)) {// not supported}    

No comments:

Post a Comment