Note that there are some explanatory texts on larger screens.

plurals
  1. POAppWidgetHostView can't handle any touch/click events?
    primarykey
    data
    text
    <p>I am a new stackoverflow registered user but have been using it for a long time now. Getting to the point : I am creating an android launcher and want to implement appWidgets. For testing, I am using the <code>com.android.quicksearchbox</code> widget and adding it to the top of the screen. Problem is, I am using AppWidgetHostView and it seems not to notice any click or touch events the user does. Can anybody tell me why ? Here is all my code for appWidgets (in the <code>onCreate(Bundle)</code> function) :</p> <pre><code> android.appwidget.AppWidgetManager appWidgetManager = android.appwidget.AppWidgetManager.getInstance(this); android.appwidget.AppWidgetHost appWidgetHost = new android.appwidget.AppWidgetHost(this, 0); android.appwidget.AppWidgetProviderInfo newAppWidgetProviderInfo = new android.appwidget.AppWidgetProviderInfo(); int appWidgetId = appWidgetHost.allocateAppWidgetId(); List&lt;android.appwidget.AppWidgetProviderInfo&gt; appWidgetInfos = new ArrayList&lt;android.appwidget.AppWidgetProviderInfo&gt;(); appWidgetInfos = appWidgetManager.getInstalledProviders(); for(int j = 0; j &lt; appWidgetInfos.size(); j++) { if (appWidgetInfos.get(j).provider.getPackageName().equals("com.android.quicksearchbox")) { newAppWidgetProviderInfo = appWidgetInfos.get(j); break; } } android.appwidget.AppWidgetHostView hostView = appWidgetHost.createView(this, appWidgetId, newAppWidgetProviderInfo); hostView.setAppWidget(appWidgetId, newAppWidgetProviderInfo); android.widget.LinearLayout ll = (android.widget.LinearLayout) findViewById(R.id.loll); ll.addView(hostView, 0); </code></pre> <p>loll is my LinearLayout.</p> <p>So anybody knows how can I enable events ? Or if there is another method of adding app-widgets to my launcher ?</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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