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

Hello.
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("ru.yandex.yandexmaps",
  5.                 "ru.yandex.yandexmaps.MapActivity"));
  6. clickintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  7. PendingIntent pendingIntentClick =
  8.         PendingIntent.getActivity( context, 0, clickintent, 0);
  9. views.setOnClickPendingIntent(R.id.trafficLevel, pendingIntentClick);
Parsed in 0.033 seconds, using GeSHi 1.0.8.4

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?
SynteZZZ
Once Poster
Once Poster
 
Posts: 1
Joined: Fri May 28, 2010 11:01 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 27 guests