Look for an app in the market out of a widget

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Look for an app in the market out of a widget

Postby moritzz » Fri Nov 27, 2009 12:42 pm

Hey guys!

I have a widget which should open the market and look for a certain application. I'm using this function to catch a click on the widget and am trying to open the given uri, which doesn't work and I don't know why. What am I missing?

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. @Override
  2.  
  3. public void onUpdate(Context context, AppWidgetManager appWidgetManager,
  4.  
  5.                 int[] appWidgetIds) {
  6.  
  7.         super.onUpdate(context, appWidgetManager, appWidgetIds);
  8.  
  9.        
  10.  
  11.        for (int i=0; i < appWidgetIds.length; i++)
  12.  
  13.        {
  14.  
  15.             int[] appWidgetId = appWidgetIds;
  16.  
  17.            
  18.  
  19.             RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.main);
  20.  
  21.              for(MappingIDs id : idList) {
  22.  
  23.                  Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse(id.getUri()));
  24.  
  25.                  PendingIntent pIntent = PendingIntent.getActivity(context, 0, intent, 0);
  26.  
  27.                  views.setOnClickPendingIntent(R.id.Button1, pIntent);
  28.  
  29.             }
  30.  
  31.            
  32.  
  33.             appWidgetManager.updateAppWidget(appWidgetId, views);
  34.  
  35.        }
  36.  
  37. }
  38.  
  39.  
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
moritzz
Junior Developer
Junior Developer
 
Posts: 11
Joined: Sat Nov 07, 2009 9:20 pm

Top

Postby moritzz » Sat Nov 28, 2009 4:27 pm

No idea? :cry:
moritzz
Junior Developer
Junior Developer
 
Posts: 11
Joined: Sat Nov 07, 2009 9:20 pm

Postby moritzz » Sun Nov 29, 2009 10:53 pm

moritzz
Junior Developer
Junior Developer
 
Posts: 11
Joined: Sat Nov 07, 2009 9:20 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests