AppWidget setPendingIntent didn't work until reboot

Put your problem here if it does not fit any of the other categories.

AppWidget setPendingIntent didn't work until reboot

Postby SynteZZZ » Fri May 28, 2010 11:06 pm

I'm creating an AppWidget application. It has a button which launches
external activity.
Here is code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent clickintent = new Intent(Intent.ACTION_MAIN);
  2. clickintent.addCategory(Intent.CATEGORY_LAUNCHER);
  3. clickintent.setComponent(
  4.         new ComponentName("",
  5.                 ""));
  6. clickintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  7. PendingIntent pendingIntentClick =
  8.         PendingIntent.getActivity( context, 0, clickintent, 0);
  9. views.setOnClickPendingIntent(, pendingIntentClick);
Parsed in 0.012 seconds, using GeSHi

The question is: why this code working ONLY after reboot of
device(testing on HTC Legend Anroid 2.1) or Emulator(2.1, 2.2. On 1.5
i can't reproduce that)?
Before reboot just nothing happens. In LogCat i see nothing on
pressing button - no errors, warnings, infos or anything.
After reboot all works fine.
Any ideas?
Once Poster
Once Poster
Posts: 1
Joined: Fri May 28, 2010 11:01 pm


Return to Other Coding-Problems

Who is online

Users browsing this forum: Majestic-12 [Bot] and 14 guests