Embed widget in android activity - not responding -
I am trying to create a home screen. I have got the widget to show the display but I have some kind of Need to send information, so it will start. Maybe me AndroidManifest.xml: Homescreen.Java: } Do anyone have a clue? According to this post, you can not program yourself as a widget entry: You have to make an intentional call that will give the user the ability to choose. I was still surprised to hear that you managed to show it ... AndroidManifest.xml
& lt; Manifest xmlns: android = "http: //schemas.android.com/apk/res/android" package = "com.Fredrik" android: versionCode = "1" Android: versionName = "1.0" & gt; & Lt; Usage-permission Android: name = "android.permission.INTERNET" /> & Lt; Application Android: Icon = "@ Drable / Icon" Android: label = "@ string / app_name" & gt; & Lt; Activity Android: name = "Homescreen" Android: label = "@ string / app_name" Android: launchMode = "Single instance" Android: stateNotNeeded = "true" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; / Application & gt; & Lt; / Reveal & gt;
Expands the public class home-cycle activity {@Override Creates the Public on Zero (Bundled Saved Instance) {super.onCreate (SavedInstanceState); Final AppWidgetManager Widget = AppWidgetManager GetStation (getApplicationContext ()); & Lt; AppWidgetProviderInfo & gt; Installed Providers = Widgets GetInstalledProviders (); (AppWidgetProviderInfo ws: installProviders) {if (ws.label.startsWith ("Music (Big)")} {AppWidgetHost h = New AppWidgetHost (getApplicationContext (), 10); Int id = h.allocateAppWidgetId (); AppWidgetHostView v = h.createView (this, id, ws); SetContentView (v); H.startListening (); break; }}}
Comments
Post a Comment