well more surprise. toast does not seem to work from AppService, but
it works from OneTimeAlarmReceiver

am i doing something stupid here ?

On Dec 16, 7:57 pm, Jags <jag...@gmail.com> wrote:
> to help with a little code
>
> ____________________________
>
> public class AppService extends WakefulIntentService {
>         public AppService() {
>                 super("AppService");
>         }
>
>         private void showMePopup(Row rec) {
>                 final FrameLayout fl = new FrameLayout(this);
>                 final TextView input = new TextView(this);
>                 input.setGravity(Gravity.CENTER);
>                 input.setSingleLine(true);
>
>                 fl.addView(input, new FrameLayout.LayoutParams
> (FrameLayout.LayoutParams.FILL_PARENT,
> FrameLayout.LayoutParams.WRAP_CONTENT));
>
>                 input.setText(rec.message);
>                 new AlertDialog.Builder(this)
>                      .setView(fl)
>                      .setTitle(R.string.app_name)
>                      .setPositiveButton("OK", new 
> DialogInterface.OnClickListener(){
>                          //@Override
>                           public void onClick(DialogInterface d, int which) {
>                                           d.dismiss();
>                           }
>                      }).create().show();
>         }
> ____________________________
>
> is it kinda bad context ? as this refers to instance of
> WakefulIntentService ? if yes how can I get proper context instance ?
>
> i am using Mark's code wakefulintentservice from github
>
> regards
>
> On Dec 16, 7:46 pm, Jags <jag...@gmail.com> wrote:
>
> > Now that I am able to send an sms from inside AppService, I am unable
> > to show an alert upon an alarm.
>
> > i get the exception 12-16 19:41:37.890: DEBUG/RemindMe(5317): Unable
> > to add window -- token null is not for an application
>
> > am I not allowed to show alert in AppService ?
> > I understand Mark opined against it, but how to convince my boss about
> > this :) . I am able to show a toast though
>
> > regards
>
> > On Dec 13, 2:15 am, Jags <jag...@gmail.com> wrote:
>
> > > Ok ! Now that I am able to fire up the alarm, how can I fire up the
> > > alarm with a little more context ? Like for example, I want to have my
> > > alarm give me a record id when it wakes me up ! How can I acheive that
> > > in a broadcast receiver ?
>
> > > regardsJagat
>
> > > On Dec 9, 7:14 pm, Jags <jag...@gmail.com> wrote:
>
> > > > very bad, blackberry allows this but. this is where blackberry scored
> > > > better than android :)
>
> > > > On Dec 9, 5:10 pm, "Mark Murphy" <mmur...@commonsware.com> wrote:
>
> > > > > > but it invokes the mail ui of android, cant I silenly send email as 
> > > > > > i
> > > > > > am sending sms ?
>
> > > > > Not unless you bundle in your own email JAR and use that. The only
> > > > > built-in ways to send emails in Android will involve user input.
>
> > > > > --
> > > > > Mark Murphy (a Commons Guy)http://commonsware.com
> > > > > Android App Developer Books:http://commonsware.com/books.html
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to