title: How do I receive this intent bundle from an appwidgetprovider? Example inside
body: <p>This is my getViewAt from my RemoteViewsService.  I need to get the position of the row clicked here and use it to send a specific url that is contained in a string array. The reason for this is so i can launch that url when the listview on the appwidget is clicked (simple bookmark widget).  </p>
  
  <pre><code>public RemoteViews getViewAt(int position){
  
      RemoteViews row = new RemoteViews(ctxt.getPackageName(),R.layout.widget_list_item);
      row.setTextViewText(R.id.widgetlisttextview,NicknamesW.get(position));
      Intent i = new Intent();
      Bundle extras = new Bundle();
  
      extras.putString("getrow",URLSW.get(position));
      i.putExtras(extras);
  
      row.setOnClickFillInIntent(R.id.widgetlisttextview,i);
  </code></pre>
  
  <p>not sure if i'm missing something here or not but that's what i have so far.</p>
  
  <p>Then here is my appwidgetprovider where i'm trying to finish the onclickIntent and launch the URL.</p>
  
  <pre><code>public void onUpdate(Context ctxt, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
  
  
  
  
      for (int i = 0; i &lt; appWidgetIds.length; i++){
          String teststr = "http://www.dummy.ca";
  
          Intent svcIntent = new Intent(ctxt,ListViewService.class);
          svcIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,appWidgetIds[i]);
          //
          svcIntent.setData(Uri.parse(svcIntent.toUri(Intent.URI_INTENT_SCHEME)));
          //
          RemoteViews widget = new RemoteViews(ctxt.getPackageName(),R.layout.widget);
          widget.setRemoteAdapter(R.id.WidgetListView,svcIntent);
  
          // set url
          Intent openurl = new Intent(Intent.ACTION_VIEW, Uri.parse(teststr));
  
          PendingIntent clickPI = PendingIntent.getActivity(ctxt,0,openurl,PendingIntent.FLAG_UPDATE_CURRENT);
  
  
          widget.setPendingIntentTemplate(R.id.WidgetListView,clickPI);
  
  
          appWidgetManager.updateAppWidget(appWidgetIds[i],widget);
  </code></pre>
  
  <p>Right now it's just launching the dummy URL from the string teststr.</p>
  
  <p>Any help would be extremely appreciated, I may be taking the wrong approach or just not receiving the intent properly i'm not sure but i'm not sure where to go next.  I don't know where the bundled intent ends up but the onclick is working with the dummy url.</p>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT 1:</p>
  
  <p>This is what i've done so far.</p>
  
  <p>// Added action to my androidmanifest "com.halls.jon.LaunchURL" in my AppWidgetProvider receiver and a default Intent category. Just trying to learn how to do this.</p>
  
  <pre><code>&lt;receiver android:name=".LinksWidget"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.appwidget.action.APPWIDGET_UPDATE"/&gt;
              &lt;action android:name="com.halls.jon.LaunchURL"/&gt;
          &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;/intent-filter&gt;
          &lt;meta-data android:name="android.appwidget.provider"
              android:resource="@xml/my_widget_provider"/&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>// Then i went over to my AppWidgetProvider and changed some of the intent and pending intent. Here is the Code:</p>
  
  <pre><code>Intent launch = new Intent("com.halls.jon.LaunchURL");
  PendingIntent clickPI = PendingIntent.getBroadcast(ctxt,0,launch,PendingIntent.FLAG_UPDATE_CURRENT);
  widget.setPendingIntentTemplate(R.id.WidgetListView,clickPI);
  </code></pre>
  
  <p>// And this is the code i wrote for my onReceive in my AppWidgetProvider.</p>
  
  <pre><code>Bundle getdata = intent.getExtras();
      if (getdata != null) {
          String URLLaunch = getdata.getString("url");
          Intent launch = new Intent(Intent.ACTION_VIEW, Uri.parse(URLLaunch));
          context.startActivity(launch);
      }
      super.onReceive(context, intent);
  </code></pre>
  
  <p>My app is crashing as soon as i try to drop a widget.  Not sure why. Any further help would be appreciated.</p>