How To Get To Another Application On Click Of A Widget
I want to get to another application when I click my widget. It doesn't seem to be working. Please tell me where I am going wrong. Here's my code so far. public class MyWidgetPro
Solution 1:
I simply added some code from onUpdate() method to onReceive() method and it worked. This is the code.
Intent in = new Intent(Intent.ACTION_MAIN);
PackageManager packageManager = context.getPackageManager();
in = packageManager.getLaunchIntentForPackage("com.playup.android.adapters");
in.addCategory(Intent.CATEGORY_LAUNCHER);
PendingIntent pendingIntent2 = PendingIntent.getActivity(context,0 /* no requestCode */, in, 0 /* no flags */);
remoteViews.setOnClickPendingIntent(R.id.layout, pendingIntent2);
Post a Comment for "How To Get To Another Application On Click Of A Widget"